Support » Plugin: User registration & user profile - Profile Builder » Apostrophe converted to ' in emailt

  • Resolved JillEB

    (@jilleb)


    The title of my website uses an apostrophe (This Isn’t What I Planned). When generating an email, the apostrophe is getting converted as follows: [This Isn't What I Planned].

    How may I correct this?

    TIA!

Viewing 1 replies (of 1 total)
  • Plugin Author Cristian Antohe

    (@sareiodata)

    Hi Jill,

    Sometimes this happens due to encoding issues. Basically your server or email client converts the apostrophe to it’s HTML counterpart.

    You could try something along these lines:

    • create an empty plugin like so: https://gist.github.com/sareiodata/76f701e01db6685829db
    • give it a proper name.
    • then add this code at the end of it:
      
      add_filter( 'wp_mail', 'wppbc_wp_mail_filter' );
      function wppbc_wp_mail_filter( $args ) {
      	
      	$new_wp_mail = array(
      		'to'          => $args['to'],
      		'subject'     => html_entity_decode($args['subject']),
      		'message'     => $args['message'],
      		'headers'     => $args['headers'],
      		'attachments' => $args['attachments'],
      	);
      	
      	return $new_wp_mail;
      }
      
    • then save this as a file and upload it in your plugins folder in your WordPress install
    • activate the new plugin and try again

    As an alternative if this doesn’t work, you could try to send those emails using an external service like https://postmarkapp.com/

    Install it’s https://wordpress.org/plugins/postmark-approved-wordpress-plugin/ WordPress plugin and set it up. Then try again.

    If you need help with any of this, please let me know!

Viewing 1 replies (of 1 total)
  • The topic ‘Apostrophe converted to ' in emailt’ is closed to new replies.