I would like to change the way the messages in digest email are stacked together. Right now the messages are divided by "----" string and they don't even start from a new line. So I want to change the way the messages are put together. Can someone point me to the place where I can do that please?

Comments

chilic’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new534 bytes

it's happens because module set email header = text/html
By default Drupal use email header text/plain.

ohthehugemanatee’s picture

If the module wants to support text/html that's fine, but I agree with @Chilic, text/plain should at least be the default. Does this need to be set explicitly by message_digest? Can we expose it as an admin option?

dmitrii’s picture

StatusFileSize
new113.13 KB

Similar issue with header at Drupal Association site. Maybe related.

BarisW’s picture

Would it be possible to do it like this?

<?php
/**
 * Implements hook_mail()
 */
function MYMODULE_mail($key, &$message, $params) {
  if ($key == 'digest') {
    // Remove the HTML formatting.
    if (isset($message['headers']['Content-Type']) {
      unset($message['headers']['Content-Type']);
    }
  }
}
?>
vali hutchison’s picture

If you install the Mime Mail module then it works fine - https://www.drupal.org/project/mimemail (Mime Mail requires Mail System to be installed so you'll need that too - https://www.drupal.org/project/mailsystem)

Install both, enable, and you should get HTML emails sent fine without any further config.

BarisW’s picture

Thanks @ValiH for the tip. Will try!

PawelR’s picture

Category: Support request » Bug report
Status: Needs review » Reviewed & tested by the community

I can't see a reason for hard coding 'text/html' in message_digest_mail().
Patch #1 should be committed.

PawelR’s picture

Patch #1 didn't apply any more.
I've re-rolled it.

chilic’s picture

Thank you @PawelR.

subhojit777’s picture

RBTC +1

bsarchive’s picture

I'm using Mime Mail and Message digest isn't picking up my mail.css styling, although message_notify is. ?

tony.herr’s picture

The patch in #8 worked for me. Thanks!

jhedstrom’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new583 bytes

Corresponding patch for 8.x. I think the 7.x version can also be committed.

  • jhedstrom committed 1d6d973 on 8.x-1.x
    Issue #2236179 by PawelR, chilic, jhedstrom, dmitrii: Formatting of the...

  • jhedstrom committed 084c176 on 7.x-1.x
    Issue #2236179 by PawelR, chilic, dmitrii: Formatting of the digest...
jhedstrom’s picture

Status: Needs review » Fixed

Committed to 7 and 8. Thanks!

Status: Fixed » Closed (fixed)

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