Hi,

I've been trying to figure this out on my own, but I'm having a hard time. I'm trying to see is there anything additional necessary in my php to send a FULL-HTML enabled email.

I do have the setting inside text-format set to Full HTML.

Here is my script:

$message = message_create('order_confirmation_message', array ( 'uid' => $commerce_order->uid) );
$wrapper = entity_metadata_wrapper('message', $message);
$wrapper->field_order_id_ref->set($commerce_order);
$wrapper->field_e_mail_subject->set("Make your appointment at Luhu");
message_notify_send_message ( $message );
CommentFileSizeAuthor
#2 2050473-notification-html-version.patch487 bytesphilipz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bsandor’s picture

Issue summary: View changes

Setting up drupal to send html mails for message_notify module is a proper solution.

Follow this instruction here: https://www.drupal.org/node/900794

philipz’s picture

I don't know if this could be a setting in rule configuration or what but here's my patch for this.

Aniessh Sethh’s picture

@philipz works as expected, thanks ....

B31’s picture

+1 for #2

sadashiv’s picture

Status: Active » Needs review

Hi,

#2 works for me as well. May be we can improve the patch to take the header value based on the configuration for the message type. I think we can use load the message type and get the text format from it but still the fix works.

Thanks,
Sadashiv.

ncameron’s picture

You can also do this using hook_mail_alter():

/**
 * Implement hook_mail_alter().
 *
 * Ensure message_notify are sent as HTML.
 *
 * @see https://www.drupal.org/node/2050473
 * @param $message
 */
function MY_MODULE_mail_alter (&$message) {
  if (!empty($message['module']) && $message['module'] == 'message_notify') {
    $message['headers']['Content-Type'] = 'text/html; charset=UTF-8';
  }
}
bluegeek9’s picture

Status: Needs review » Closed (outdated)