givewp icon indicating copy to clipboard operation
givewp copied to clipboard

[Preview email] should...

Open Genevieve-K opened this issue 3 years ago • 2 comments

User Story

As an admin, I want to preview emails with a donation ID and there is an error.

Details

On the email list, I want to preview an email. I see the email no associated to a donation. I choose a donation, and there is the error, the session is not recognized.

Expected Behavior

The email must be displayed for a donation.

Steps to Reproduce

  1. Go to Settings > Emails
  2. Choose an email(e.g. Donation Receipt) and click Preview
  3. Select a donation to preview
  4. Error: We're unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.

Visuals

image

Additional Context

The URL is escaped, The '&' are replaced by '&' and the nonce is not regognized. Example with localhost: Escaped URL: https://localhost/test-give/?give_action=preview_email&email_type=donation-receipt&_wpnonce=cdfe35823e&preview_id=134 Expected URL: https://localhost/test-give?give_action=preview_email&email_type=donation-receipt&_wpnonce=cdfe35823e&preview_id=134

Genevieve-K avatar Jun 30 '22 20:06 Genevieve-K

Hi @Genevieve-K!

Thank you for reporting this! I just threw together a PR to fix this: https://github.com/impress-org/givewp/pull/6508

Would you be so kind as to test that and make sure it resolves the issue for you as well? You can also download a zip here if you'd prefer to do that: https://github.com/impress-org/givewp/actions/runs/2619432075

Much appreciated!

JasonTheAdams avatar Jul 05 '22 23:07 JasonTheAdams

Hi @JasonTheAdams, I replaced 'esc_url' bay 'esc_url_raw' in the four files. It works! Thank you.

Genevieve-K avatar Jul 06 '22 21:07 Genevieve-K

Resolved in https://github.com/impress-org/givewp/pull/6508.

JoshuaHungDinh avatar Aug 17 '22 15:08 JoshuaHungDinh