Order confirmation email display issue

Site: alexbeaton.com
Marketpress: Version 2.9.4 updated on 4/20/2014

After my last update to V2.9.4 order confirmation emails are showing the code for ' as &#8217

See examples:

Before:

A new order (cd98378c29fb) was created in your store:

Order Information:
Items:
	1 @ 10.00	10.00 USD	From The Sea To The Shore
	1 @ 20.00	20.00 USD	Alex Beaton's Scotland DVD
	------------------------------------------------------
	Subtotal:	30.00 USD
	Shipping:	5.00 USD
	Taxes		2.39 USD
	Order Total:	37.39 USD

After:

A new order (591221781eb6) was created in your store:

Order Information:
Items:
	1 @ 20.00	20.00 USD	Live In Concert
	1 @ 20.00	20.00 USD	Alex Beaton&#8217s Scotland DVD
	------------------------------------------------------
	Subtotal:	40.00 USD
	Shipping:	6.00 USD
	Order Total:	46.00 USD

I've looked through the code but can't find anything to cause this.
Your guidance is appreciated.

Merv (@lzw8bk)

Note: I removed the ; after &#8217 to get it to display in the code blocks above.

  • lzw8bk
    • WPMU DEV Initiate

    Update,
    I browsed the wordpress_post table and found under post_type that the post_content serialized array has the actual ' character prior to V 2.9.4 and the html entity &#8217 after. The email creation code in marketpress.php does not decode it for email content.

    As a simple solution I added
    str_replace('’', '\'',$data['name'])
    to the email creation logic in marketpress.php.

    If entities are added to other fields in the database, then there should be a more global solution at least for formatting all data for proper display of email.

  • Jonathan
    • The Bug Hunter

    Hi Merv,

    Thanks for the solution. Here's what I've got in place for 2.9.4.2 set to release later today - line 4588 ish of marketpress.php:

    return wp_mail($to, $subject, $msg);

    changed to:

    return return wp_mail($to, $subject, html_entity_decode($msg));

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.