• Resolved John

    (@jsing)


    I found the conversation here about mailgun not sending emails as html:

    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

    (@jsing)

    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

    (@timersys)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mailgun HTML’ is closed to new replies.