Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email access token logic to "View In Browser" link in Donation Receipt email #1790

Closed
2 tasks
Benunc opened this issue Jun 21, 2017 · 7 comments
Closed
2 tasks
Assignees
Milestone

Comments

@Benunc
Copy link
Member

Benunc commented Jun 21, 2017

Issue Overview

Currently, the "view in browser" link in a donation confirmation email will only work if the link opens in a browser where the transaction just took place, because the session is still active.

Expected Behavior

The "View In Browser" link should create a session in the same way an email access token does. That way, no matter where the donor clicks that link (on a different device, using a different browser, etc), they will have access to the donation receipt and other associated donor account information.

Current Behavior

Site is set up without email access, and no login is required to donate (on a one-time donation).

Donor submits a one-time donation on his laptop, but does not immediately check his email. Later, on his phone, he clicks the "view receipt in browser" link.

He's greeted with this confusing box:
screen shot 2017-06-21 at 3 02 04 pm

He doesn't have a login. So he's stuck.

Possible Solution

Since we already know the user has access to the email account (where he clicked the link), it would make sense to add some of the verified token logic from our email access class to that link. That way, no matter what device he's on, the donor can see his donation receipt and history.

This is what is added in our email access class once the token has been verified:

add_filter( 'give_can_view_receipt', '__return_true' );
add_filter( 'give_user_pending_verification', '__return_false' );
add_filter( 'give_get_users_donations_args', array( $this, 'users_donations_args' ) );

This line is here: https://github.com/WordImpress/Give/blob/master/includes/class-give-email-access.php#L142

Steps to Reproduce (for bugs)

  1. Email access disabled.
  2. One time donation form where guest donations are accepted, and no login/register fields shown.
  3. Email receipt includes the {receipt_link} tag.
  4. Submit donation.
  5. Follow link in email, but make sure to open the link in a different browser than the transaction took place in.

You'll get the box above.

Even with Email access enabled, you'll still get a confusing "put in your email" form, and that seems unnecessary because we already know they have access to that email. They clicked a link in it.

Todos

  • Tests
  • Update Documentation
@ravinderk ravinderk added UI / UX and removed UI / UX labels Jun 22, 2017
@ravinderk ravinderk added this to the 1.8.10 milestone Jun 22, 2017
@ravinderk
Copy link
Collaborator

@Benunc Make sense. I will think about it how we can make donor experience better with donor reciepts and Let you know.

@mehul0810
Copy link
Contributor

@ravinderk @DevinWalker I've added some of my findings and suggestions after testing as per our discussion over call today.

Some Findings

  • When Guest Donation is enabled, then Email Access should get enabled otherwise it will ask for login when a View it in browser link is clicked.
  • When Guest Donation is disabled, then Email should get disabled otherwise it will create a non secure environment where admin doesn't want the donation receipts shown to anonymous user.
  • If email access is enabled and then proceed with transaction of any form. You'll receive an email containing View it in browser, click on it. It will ask for email to enter. Then I've entered a different email from which i did the transaction and it is showing me the donations list of the email which i entered. This seems to be a weird case. This same case is for No Login.
  • If email access is disabled and then proceed with transaction of any form. You'll receive an email containing View it in browser, click on it. then you'll be redirected to the payment receipt, if you're using the same browser session with which you have made the transaction. If you check the same in incognito mode then it will ask for login which you won't be having in case of forms not asking for login or registration.

Suggestions

  • On installing Give, default option for Email Access should be enabled as per the discussion with @DevinWalker and @ravinderk over call.
  • On using login or registration option with Guest Checkout disabled then the Email Access should get disabled as well.
  • Need improvement in the View it in browser link, where we will add access token as a query parameter with the link and then when opening that link, we'll verify that the access token created is for specific email. If verified, then user will be able to access the receipt without additional step of sending access token and verifying the email again.

@DevinWalker
Copy link
Member

Response

1. Ensure the Email Access is enabled for all new installs by default

2.

On using login or registration option with Guest Checkout disabled then the Email Access should get disabled as well.

Disagree, leave it enabled. Email Access only applies to after the donation to retrieve donation records and manage subscriptions, etc. This should be easily accessible still.

3.

Need improvement in the View it in browser link, where we will add access token as a query parameter with the link and then when opening that link, we'll verify that the access token created is for specific email. If verified, then user will be able to access the receipt without additional step of sending access token and verifying the email again.

Agreed. This is the underlying issue we're trying to address here. Please resolve this as you describe.

@DevinWalker DevinWalker modified the milestones: 1.8.14, 1.8.15 Sep 27, 2017
@mehul0810 mehul0810 mentioned this issue Oct 12, 2017
3 tasks
@DevinWalker DevinWalker removed this from the 1.8.15 milestone Oct 19, 2017
@DevinWalker DevinWalker added this to the 1.8.16 milestone Oct 19, 2017
@raftaar1191
Copy link
Contributor

Getting noticed:

image

@mehul0810 mehul0810 mentioned this issue Oct 26, 2017
3 tasks
@ravinderk
Copy link
Collaborator

@raftaar1191 Issue has been fixed. Please review again.

@raftaar1191
Copy link
Contributor

Checking @ravinderk

@raftaar1191
Copy link
Contributor

Checking and updating in the sheet @ravinderk

Thanks @mehul0810 for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants