Title: Html Emails support
Last modified: March 3, 2017

---

# Html Emails support

 *  [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/html-emails-support/)
 * Hi, Im the plugin author of [email templates plugin](https://wordpress.org/plugins/email-templates/).
 * Could you please add a filter hook in your plugin so I can replace the mail content
   with an HTML template ?
 * For your reference this is how I do regular it for phpmailer:
 *     ```
       /**
       	 * Modify php mailer body with final email
       	 *
       	 * @since 1.0.0
       	 * @param object $phpmailer
       	 */
       	function send_email( &$phpmailer ) {
       		do_action( 'mailtpl/send_email', $phpmailer, $this );
       		$message            =  $this->add_template( apply_filters( 'mailtpl/email_content', $phpmailer->Body ) );
       		$phpmailer->AltBody =  $this->replace_placeholders( strip_tags($phpmailer->Body) );
       		$phpmailer->Body    =  $this->replace_placeholders( $message );
   
       	}
       ```
   
 * But it seems that you create a new instance of phpmailer instead of using existing
   one, so that is not working. A hook will solve this.
 * Other plugins like mailgun or mandrill that uses their own functions or API have
   hooks to modify the html and I do something like this:
 *     ```
       	/**
       	 * Mandrill Compatibility
       	 * @param $message Array
       	 *
       	 * @return Array
       	 */
       	public function send_email_mandrill( $message ) {
       		do_action( 'mailtpl/send_email_mandrill', $message, $this );
       		$temp_message       =  $this->add_template( apply_filters( 'mailtpl/email_content', $message['html'] ) );
       		$message['html']    =  $this->replace_placeholders( $temp_message );
       		return $message;
       	}
       ```
   
 * A couple of your users will be happy to make both plugins works together. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Brevo](https://wordpress.org/support/users/neeraj_slit/)
 * (@neeraj_slit)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/html-emails-support/#post-8870117)
 * Hi
 * Thanks for your advise.
    We will add a hook as your report in new version soon.
 * Regard
 *  [olivercowan](https://wordpress.org/support/users/olivercowan/)
 * (@olivercowan)
 * [9 years ago](https://wordpress.org/support/topic/html-emails-support/#post-9187701)
 * Hi, I am using your SendinBlue plugin and would really like integration with 
   the email templates plugin. Has this been added yet?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Html Emails support’ is closed to new replies.

 * ![](https://ps.w.org/mailin/assets/icon-256x256.png?rev=2993173)
 * [Brevo - Email, SMS, Web Push, Chat, and more.](https://wordpress.org/plugins/mailin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailin/)
 * [Active Topics](https://wordpress.org/support/plugin/mailin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailin/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [olivercowan](https://wordpress.org/support/users/olivercowan/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/html-emails-support/#post-9187701)
 * Status: not resolved