Knowledge Base/Articles/Apps

Plain text emails converted to HTML

Joe Scharf
posted this on February 12, 2010 13:39

If you are sending plain text emails, you may have noticed that, in some cases, your email is converted to HTML. This typically happens when you have one or more filters enabled that require a HTML version of the message you are sending.

Why does this happen?

The following filters convert plain text emails to HTML so the proper HTML tags can be inserted into the email:

  • Click tracking
  • Open tracking
  • Email template
  • Gravatar

How can I control the resulting conversion (see update below)

  1. You can turn off the filters causing the conversion from plain text to HTML.
  2. If you start each line with a space, this will add a "preformatted" <pre> tag around the line.
  3. You can separate new sentences with double newlines, which will add a "paragraph" <p> tag around the sentence.
  4. You can convert your message to HTML, bypassing our need to convert it altogether

UPDATE:

You can now disable plain-text to HTML conversion globally or just for click tracking.

  • To disable conversion globally, visit Account->Global Settings and check the "Don't convert plain text emails to HTML" checkbox (See Example)
  • To disable conversion just for click tracking visit Filters and click on the settings link for Click Tracking. Ensure the checkbox "Enable click tracking in plain text emails" is unchecked (See Example)

 

Why can't you just automatically add <br /> tags to newlines upon conversion?

Due to the way plain text emails are sent (RFC 5822, Revised 2008) mailers are required to wrap lines at 998 characters, and recommends wrapping at 78 characters (excluding CR/LF). As a result, long sentences can often be broken up into multiple lines. Adding <br /> tags to each newline, would therefore create formatting problems.

For more information

We use the open-source library MKDoc-Text-Structured to perform the plain-text to HTML conversion. More information about this library and how it works can be found on the MKDoc-Text-Structured documentation page.