In case it is relevant, I also use the smtp module, and I have configured my mailsystem, smtp and htmlmail as described here: http://drupal.org/node/1200142

Now, this works fine to send html mails, but alas it trashes all non-html mails sent by the system. User registration mails, webform submissions, ... all of them have all their enters removed. Looking at the email headers & contents, it is clear why this happens:

X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
MIME-Version: 1.0
Content-Transfer-Encoding: 8Bit
Content-Type: text/html; charset="utf-8"

<div class="htmlmail-body">
Here the content body.
Here something that should have been on a different line, without <br /> to do it.
</div>

Have I missed anything in my configuration, or what would be the proper way to make non-html emails display correctly to my users?

Comments

P3t3r’s picture

Project: HTML Mail » Drupal core
Version: 7.x-2.65 » 8.x-dev
Component: Code » markup
Category: support » feature
Issue tags: +wysiwyg htmlmail

I'm moving this to drupal core since I think the real problem is there.

The page at admin/config/people/accounts blocks the WYSIWYG editor to write proper markup for html mails. Why is wysiwyg input not allowed on these mail template input fields?

joelpittet’s picture

Project: Drupal core » HTML Mail
Version: 8.0.x-dev » 8.x-2.x-dev
Component: markup » Code
Category: Feature request » Support request
Issue summary: View changes

Hmm I don't think so, moving this back to htmlmail or possibly mailsystem queue. That will need a much better issue summary if this is a core problem.

How does it 'block' them?

http://drupal.stackexchange.com/questions/9780/attach-wysiwyg-to-drupal-...
https://www.drupal.org/node/1031160

TR’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Active » Closed (works as designed)
Issue tags: -wysiwyg htmlmail

HTML Mail assumes your input is an HTML message body. It does not magically detect that your input is plain text and convert it to HTML for you. If you want to send HTML system messages, then edit the system message and add the appropriate markup. If you DON'T want to send HTML system messages, then configure Mailsystem so that the system messages are sent with PHPMail (the default) and not with HTML Mail.

Also, in reference to #1, Drupal core does not support HTML email, so it makes no sense at all for a WYSIWYG editor to be used for entering the system message text. If that is what you want, then you can hook_form_alter() that system form and add a WYSIWYG editor. It is neither the responsibility of core Drupal nor of HTML Mail to decide to add that WYSIWYG editor for you.