impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
344 stars 191 forks source link

fix(emails): Special char display for currency sign for the Plain text Email type. #2515

Closed jaydeeprami closed 6 years ago

jaydeeprami commented 6 years ago

Issue Overview

screen shot 2017-06-01 at 11 16 47 am

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

  1. Create Donation with INR currency
  2. Go to Email settings and choose Email content type as a 'Plain and text'.
  3. Preview donation which made with INR Currency.
  4. It shows special char for the donation amount currency.

Related Issues and/or PRs

Todos

WordPress Environment

``` ### WordPress Environment ### Home URL: http://givewp.dev Site URL: http://givewp.dev WP Version: 4.9.1 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: 3 Table Prefix Status: Acceptable Admin AJAX: Inaccessible Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, refunded, failed, revoked, cancelled, abandoned, processing, preapproval ### Server Environment ### Hosting Provider: DBH: localhost, SRV: givewp.dev TLS Connection: TLS Connection: Server Info: nginx/1.10.1 PHP Version: ❌ 5.3.29 - We recommend a minimum PHP version of 5.6. See: PHP Requirements in Give PHP Post Max Size: 1,000 MB PHP Time Limit: 0 PHP Max Input Vars: 3000 PHP Max Upload Size: 1,000 MB cURL Version: ❌ 7.38.0, OpenSSL/1.0.2h - We recommend a minimum cURL version of 7.40. SUHOSIN Installed: – MySQL Version: ❌ 5.5.55 - 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: ❌ wp_remote_post() failed. PayPal IPN won't work with your server. Contact your hosting provider. Error: cURL error 28: Resolving timed out after 10523 milliseconds Remote Get: ❌ wp_remote_get() failed. The Give plugin updater won't work with your server. Contact your hosting provider. Error: cURL error 28: Resolving timed out after 5519 milliseconds ### Give Configuration ### Give Version: 1.8.18 Upgraded From: 2.0.0 Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: http://givewp.dev/donation-confirmation/ Failure Page: http://givewp.dev/donation-failed/ Donation History Page: http://givewp.dev/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: Test Donation, Offline Donation, PayPal Standard Default Payment Gateway: Test Donation PayPal IPN Verification: Enabled PayPal IPN Notifications: N/A Admin Email Notifications: Enabled Donor Email Access: Enabled ### Session Configuration ### Give Use Sessions: Enabled Session: Disabled ### Active Give Add-ons ### ### Other Active Plugins ### Query Monitor: by John Blackbourn – 2.17.0 ### Inactive Plugins ### Give - Currency Switcher: by WordImpress – 1.0.0 Give - Email Reports: by WordImpress – 1.0.1 Give - Fee Recovery: by WordImpress – 1.3.3 Give - Form Field Manager: by WordImpress – 1.2.3 Give - Gift Aid: by WordImpress – 1.0.0 Give - PDF Receipts: by WordImpress – 2.2 Give - Recurring Donations: by WordImpress – 1.4 Give - Setting API Fields Example: by WordImpress – 1.0 Give - Stripe Gateway: by WordImpress – 1.5 Give - Tributes: by WordImpress – 1.2 WP-Cron Control: by Thorsten Ott, Erick Hitter, Automattic – 0.7.1 WP Crontrol: by John Blackbourn & contributors – 1.6.2 ### Active MU Plugins ### Local by Flywheel Relative URL (for Live Links): by Flywheel – 1.0 ### Theme ### Name: Twenty Seventeen Version: 1.4 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 ```
mehul0810 commented 6 years ago

@DevinWalker I have investigated more into this issue and discussed with @ravinderk over the call.

Findings

  1. Issue can be reproduced with any currency when running Give on PHP 5.3.
  2. Issue is with our Preview Email page which is rendering text/html by default in a weird manner so that is created issue with html decoding.
  3. Preview Email works on refresh which might also be a cause of the issue as it will always render text/html

Suggestions

  1. We can resolve it by revamping the whole section of Preview Email.
  2. Can we have the section similar to Mail Hog, where emails shown will be replaced with donations and clicking donations will show both the modes ( i.e. Plain or HTML ) irrespective of the settings because in current scenario we can't preview HTML/Plain text at a single location. We need to go and change the settings.
  3. Mail Hog is using Angular JS to manage the Plain Text and HTML Emails. So, we can use React or ES6 whichever we look forward for default JS framework for Give.

Screenshots with issues

image

image

DevinWalker commented 6 years ago

I just checked in PHP 5.3 with plain text and it appears for my preview:

2018-03-06_01-22-51.png

I like the idea of improving our email preview with react like @mehul0810 mentioned but that's a separate issue. Closing this one out.