• On a test server for a new site I installed Mailing Group Listserv and then all new user emails lose their HTML formatting showing the code for br like this:

    New user registration on my site:<br />
    <br />
    Username: [email protected]<br />
    E-mail: [email protected].  

    I switched the the 2017 theme and De-activated all other plugins, leaving Mailing Group Listserv active and still got the same results, broke the HTML in the new user emails.

    I found a workaround Here on post 4-5 that forces HTML for WP-mail and added it to a custom plugin:

    /*
    * Force HTML content type format for wp_mail
    */
    function set_content_type( $content_type ){
    
      if( empty($content_type) OR $content_type == 'text/plain' ) {
        $content_type = 'text/html';
      }
    
     return $content_type;
    
    }
    add_filter( 'wp_mail_content_type', 'set_content_type', 1 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ForestD

    (@forestd)

    One more thing found is that the WP admin receives two duplicate emails for new users, one that the HTML is working on and one that it is not.

    Also can we change or add a reply-to option to only send a reply to the single email address of the original sender instead of sending to the complete list?

    Plugin Author Yamna Khawaja

    (@marcusbs)

    I cannot replicate this issue of duplicate emails on subscription. Can you confirm that there is any other plugin that is also handling new user registration. Are both emails same content, except that one is HTML and one is not?

    For removing content type html filter from notification emails, you can simply do write this in functions.php:

    remove_filter(‘wp_mail_content_type’, ‘wpmg_set_content_type’);

    About replying to original sender, Premium plugin has hooks to achieve this. You can write your function using those hooks and configure reply to address according to your requirements.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML not working in new user emails’ is closed to new replies.