When I receive a notification of a product sale, the email is written in html, but the content type is set to text/plain instead of text/html. Therefore the message I receive reads:

<p><a href="https://www.mysite.com/user/3/selling/fulfill/18">Click here to view order #18.</a></p>

instead of:

Click here to view order #18.

Comments

syndicateStorm’s picture

I can't test the following code because I'm having problems with Ubercart and ubercart.org is also down. Anyways the following might fix the problem. Just replace the last function in the mp_orders.module file with:

function mp_orders_mail($key, &$message, $settings) {
  switch($key) {
    case 'sellercheckout':
      
      // Set up the header so the email shows up as html instead of plain text
      $headers = array(
        'MIME-Version' => '1.0',
        'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
        'Content-Transfer-Encoding' => '8Bit',
        'X-Mailer' => 'Drupal'
      );
      foreach ($headers as $key => $value) {
        $message['headers'][$key] = $value;
      }
      
      // Subject and body of the email
      $subject = token_replace_multiple($settings['subject'], $settings['token_filters']);
      $body = token_replace_multiple($settings['message'], $settings['token_filters']);
      $body = check_markup($body, 3, FALSE);
      $body = str_replace('*uid*', check_plain($settings['uid']), $body);
      $message['subject'] = $subject;
      $message['body'] = $body;
    break;
  }
}

If you test this let me know. Hopefully it works :-)

syndicateStorm’s picture

Status: Active » Fixed

Well it's not every day that untested code works on the first try :-) That seemed to do the trick though. The changes have been committed to the 6.x dev release and will show up in the production release when it comes out. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.