wordpress
wordpress copied to clipboard
Apostrophe in From Name renders inccorectly in email client
Screenshot: https://cl.ly/002F1646173c
How to Reproduce:
Send an email with a from name containing an apostrophe eg: Bob's Candy Shop
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.