Send plaintext email

Issue #16 resolved
David Gloe created an issue

Currently only html email can be sent. It would be nice to be able to send plaintext email for those who prefer it.

To reproduce, create a email body template with no html tags in it. The resulting email will have Content-Type: text/html; charset="UTF-8" and a meta tag at the beginning.

Comments (2)

  1. Matt Larson

    I realize this is an old issue, but I have hit the same problem with this very useful plugin and wanted to second this. Sometimes the plain text emails can be helpful for system-to-system communication with legacy systems (at least that's my use case), but the "Content-Type: text/html" line is inserted into the email regardless of whether there is html content, like this:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    I have not had a chance to look at a fix, but one possible source of this problem is in SmtpNotificationRenderer.java, line 45:

    MailMessage mailMessage = new MailMessage.Builder().to(emailAddress).from(from).subject(subject).text(body).header("Content-type", "text/html; charset=UTF-8").build();

    This line adds a content type of "text/html" to every email. So the fact that it is defaulted may prevent true plain text emails from being sent.

  2. Log in to comment