wordpress icon indicating copy to clipboard operation
wordpress copied to clipboard

Apostrophe in From Name renders inccorectly in email client

Open daronspence opened this issue 7 years ago • 1 comments

Screenshot: https://cl.ly/002F1646173c

How to Reproduce:

Send an email with a from name containing an apostrophe eg: Bob's Candy Shop

daronspence avatar Aug 07 '18 17:08 daronspence

FYI I think I tracked down the problem. It's in lib/class-sendgrid-settings.php line 692. There's this

if ( isset( $params['sendgrid_name'] ) ) {
      $from_name = htmlspecialchars( $params['sendgrid_name'], ENT_QUOTES, 'UTF-8' );
      Sendgrid_Tools::set_from_name( $from_name );
    }

So it takes a name like Bob's Candy Shop, and htmlspecialchars turns the apostraphe into an HTML entity, ie Bob's Candy Shop, and email "from" names aren't HTML, so it gets rendered as plaintext.

mnelson4 avatar Aug 07 '18 18:08 mnelson4