Title: Mailgun HTML
Last modified: March 6, 2017

---

# Mailgun HTML

 *  Resolved [John](https://wordpress.org/support/users/jsing/)
 * (@jsing)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/mailgun-html/)
 * I found the conversation here about mailgun not sending emails as html:
 * [mailgun-emails-sending-as-plain-text](https://wordpress.org/support/topic/mailgun-emails-sending-as-plain-text)
 * You mentioned that you had a potential fix to coincide with them adding a filter.
   Could you share that function. I would be happy to test it with their new hook
   mg_mutate_message_body.

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

 *  Thread Starter [John](https://wordpress.org/support/users/jsing/)
 * (@jsing)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/mailgun-html/#post-8882267)
 * For anyone else having this issue, this worked for me:
 * add this after line 194 in email-templates/includes/class-mailtpl.php
 * `$this->loader->add_filter( 'mg_mutate_message_body', $this->mailer, 'send_email_mailgun');`
 * and the following after line 106 in email-templates/includes/class-mailtpl-mailer.
   php
 *     ```
       /**
        * Mailgun HTML Compatibility
        * @param $message Array
        *
        * @return Array
        */
       public function send_email_mailgun( $message ) {
         do_action( 'mailtpl/send_email_mailgun', $message, #this );
         $temp_message     =  $this->add_template( apply_filters( 'mailtpl/email_content', $message['html'] ) );
         $message['html']  = $this->replace_placeholders( $temp_message );
         return $message;
       }
       ```
   
 *  [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/mailgun-html/#post-8921227)
 * This version have the fix [https://github.com/timersys/wordpress-email-templates/tree/develop](https://github.com/timersys/wordpress-email-templates/tree/develop)

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

The topic ‘Mailgun HTML’ is closed to new replies.

 * ![](https://ps.w.org/email-templates/assets/icon-256x256.gif?rev=2891165)
 * [Email Templates Customizer and Designer for WordPress and WooCommerce](https://wordpress.org/plugins/email-templates/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-templates/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-templates/)
 * [Active Topics](https://wordpress.org/support/plugin/email-templates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-templates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-templates/reviews/)

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)

 * 2 replies
 * 2 participants
 * Last reply from: [Damian](https://wordpress.org/support/users/timersys/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/mailgun-html/#post-8921227)
 * Status: resolved