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

fix: support {payment_total} tag in email subject #3922

Closed
3 of 5 tasks
Benunc opened this issue Jan 7, 2019 · 1 comment
Closed
3 of 5 tasks

fix: support {payment_total} tag in email subject #3922

Benunc opened this issue Jan 7, 2019 · 1 comment
Assignees

Comments

@Benunc
Copy link
Member

Benunc commented Jan 7, 2019

Bug Report

User Story

As a site admin, I want the {payment_total} email tag to work in Email Subjects so that I don't have to use the {amount} tag which also breaks down fee + total.

Current Behavior

{payment_total}

The $ character is output as an HTML entity $ within the email subject, but correctly in the email body.

{amount}

The $ cahracter is output correctly in both places.

Expected Behavior

I expect the {payment_total} tag to work in both places as the {amount} tag does.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

  1. Use the {payment_total} tag in both the email subject and email body of a message.
  2. Actually send the email (the preview feature is unreliable to replicate the issue, and services like email cop don't reproduce)
  3. The html entity is output in the email subject.

Visuals

screen shot 2019-01-07 at 2 04 55 pm

Possible Solution

This works as a workaround:

function my_give_email_tag_decoder($payment_total, $tag_args) {
	
	$escaped_total = html_entity_decode( $payment_total, ENT_COMPAT, 'UTF-8' );
	return $escaped_total;
 
}

add_filter( 'give_email_tag_payment_total', 'my_give_email_tag_decoder', 10, 2 );

...so I would assume simply adding that html_entity_decode() to the code will resolve this.

Acceptance Criteria

  • The {payment_total} tag works in the email subject.
  • It still works in the email body.
  • [ ]

Environment

Operating System
  • Platform: Mac OS X
  • Version: 10.11.6
Browser
  • Name: Chrome
  • Version: 71.0.3578.98
WordPress System Info ### WordPress Environment ###

Home URL: https://livegive.wpsteward.com
Site URL: https://livegive.wpsteward.com
WP Version: 5.0.2
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
Show on Front: posts
Table Prefix Length: wp_8138bfdc07_
Table Prefix Length: 14
Table Prefix Status: Acceptable
Admin AJAX: Accessible
Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, request-pending, request-confirmed, request-failed, request-completed, refunded, failed, revoked, cancelled, abandoned, processing, preapproval, give_subscription

Server Environment

Hosting Provider: DBH: localhost, SRV: livegive.wpsteward.com
TLS Connection: Connection uses TLS 1.2
TLS Connection: Probably Okay
Server Info: Apache/2.4.37 (Unix) OpenSSL/1.0.1f
PHP Version: 7.3.0
PHP Post Max Size: 1 GB
PHP Time Limit: 30
PHP Max Input Vars: 5000
PHP Max Upload Size: 512 MB
cURL Version: ❌ 7.35.0, OpenSSL/1.0.1f - We recommend a minimum cURL version of 7.40.
SUHOSIN Installed: –
MySQL Version: ❌ 5.5.62 - We recommend a minimum MySQL version of 5.6. See: WordPress Requirements
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
gzip: ✔
GD Graphics Library: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Give Configuration

Give Version: 2.3.1
Give Cache: Enabled
Database Updates: All DB Updates Completed.
Give Cache: Enabled
Give Cache: ✔New Donation✔Donation Receipt❌New Offline Donation❌Offline Donation Instructions✔New User Registration✔User Registration Information✔Donor Note✔Email access❌Renewal Receipt Email❌Renewal Receipt Email❌Subscription Cancelled Email❌Subscription Cancelled Email❌Subscription Completed Email✔Subscription Reminder Email✔Subscriptions Email Access
Upgraded From: 2.3.0
Test Mode: Enabled
Currency Code: USD
Currency Position: After
Decimal Separator: .
Thousands Separator: ,
Success Page: https://livegive.wpsteward.com/donation-confirmation/
Failure Page: –
Donation History Page: https://livegive.wpsteward.com/donation-history/
Give Forms Slug: /donations/
Enabled Payment Gateways: Test Donation, Stripe - Credit Card, PayPal Payments Pro, Stripe + Plaid, PayPal Standard, Authorize.net
Default Payment Gateway: Stripe - Credit Card
PayPal IPN Verification: Disabled
PayPal IPN Notifications: IPN received for #1626 ( 7G231521RB710244C ) on 12/28/2018 at 19:40. Status N/A
Donor Email Access: Enabled

Active Give Add-ons

Give - Authorize.net Gateway: ✔ Licensed – by WordImpress – 1.4.3
Give - Currency Switcher: ❌ Unlicensed – by GiveWP – 1.3.1
Give - Fee Recovery: ❌ Unlicensed – by GiveWP – 1.7.3
Give - Form Field Manager: ❌ Unlicensed – by GiveWP – 1.4.1
Give - Google Analytics Donation Tracking: ❌ Unlicensed – by GiveWP – 1.2.2
Give - MailChimp: ❌ Unlicensed – by GiveWP – 1.4.3
Give - Manual Donations: ❌ Unlicensed – by GiveWP – 1.4.2
Give - PayPal Pro Gateway: ❌ Unlicensed – by GiveWP – 1.2.1
Give - PDF Receipts: ❌ Unlicensed – by GiveWP – 2.3.2
Give - Recurring Donations: ❌ Unlicensed – by GiveWP – 1.8.3
Give - Stripe Gateway: ❌ Unlicensed – by GiveWP – 2.1.2
Give - Tributes: ❌ Unlicensed – by GiveWP – 1.5.2
Give - Zapier: ✔ Licensed – by WordImpress – 1.2.1

Other Active Plugins

Ben's Helper Functions: by BenUNC –
Better Click To Tweet: by Ben Meredith – 5.6.5
Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.3.3
Loco Translate: by Tim Whitlock – 2.2.0
Query Monitor: by John Blackbourn & contributors – 3.2.2
Steady for WordPress: by Steady – 1.0.9
User Switching: by John Blackbourn & contributors – 1.4.0
WP Crontrol: by John Blackbourn & contributors – 1.6.2

Inactive Plugins

Email Cop: by Ashfame – 0.1.1
Give - AmeriCloud Payments: by AmeriCloud Solutions, Inc. – 1.3.1
Give - Database HealthCheck: by WordImpress – 0.0.2
Give - Email Reports: by WordImpress – 1.1.2
Give - Mollie Gateway: by WordImpress – 1.1.1
Gutenberg: by Gutenberg Team – 4.7.1
Hello Dolly: by Matt Mullenweg – 1.6

Active MU Plugins

api-hacks.php: by –

Theme

Name: Twenty Seventeen
Version: 1.9
Author URL: https://wordpress.org/
Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme

@kevinwhoffman
Copy link
Contributor

@nishitlangaliya Please also review other email tags that use currency symbols and ensure they are encoded properly.

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

3 participants