Mjml: ability to generate plaintext version

Created on 11 Nov 2018  Â·  5Comments  Â·  Source: mjmlio/mjml

I currently use Zurb Foundation Email templates and send it to a Premailer server which generates both html and plaintext version. I would like to switch over to mj but it seems I would have to give up my automatic plaintext generation feature as mj appears not to provide plaintext.

Describe the solution you'd like
api returns both html and plaintext version of the template

Describe alternatives you've considered
Premailer service returns both html and plaintext in the single response

Additional context
I am unsure of the value of this feature request. Can you give feedback on the current value to spam filters and end users of sending a plaintext version along with html? Perhaps I can switch to mj and not worry about plaintext anymore. Or do you recommend users generate a plaintext version on their own and send that along with mj template result?

Most helpful comment

Probably not, we want to focus on generating responsive email HTML (which is also why we don't want to add templating language features in MJML).

Also, there are already good solutions for generating text from HTML so we don't want to reinvent the wheel by creating a parser MJML -> Text. An alternative would be to use a tool and do MJML -> HTML -> Text but that defeats the purpose of implementing it in MJML, and you'd be better off doing that using the tool of your choice.

I'll close the issue but feel free to add any comment based on what you end up using and your feedback about the tool you try as it could be helpful for others :).

All 5 comments

Hey @Enalmada,

Why don't you keep using Premailer with MJML? You just need to submit the HTML generated from MJML to Premailer and get the plain-text version, like you're doing currently.

About your question, it's good to add a plain-text version to your emails for people using an email client that doesn't support HTML (even if it's generally rare).

Thanks for the feedback about plain-text still being a best practice. I will continue to use premailer for now. Premailer homepage says it is no longer being maintained so I am keeping my eyes out for a more modern solution. What do you recommend or think most mjml users are doing to generate plain text versions of email? I am curious to factor that into how impactful this feature request could be to the community.

You should take a look at html2text, I think it does exactly what you want ?

On Mon, Nov 12, 2018 at 8:14 PM Adam Lane notifications@github.com wrote:

Thanks for the feedback about plain-text still being a best practice. I
will continue to use premailer for now. Premailer homepage
http://premailer.dialect.ca/ says it is no longer being maintained so I
am keeping my eyes out for a more modern solution. What do you recommend or
think most mjml users are doing to generate plain text versions of email? I
am curious to factor that into how impactful this feature request could be
to the community.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mjmlio/mjml/issues/1423#issuecomment-437988593, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAizzbtNCw7v-EPJaVkChUwfUdli7iAgks5uucIlgaJpZM4YYolt
.

--
Cordialement,
Maxime BRAZEILLES

html2text is an excellent suggestion I will look into further. Part of me just guesses premailer probably has a few years worth of open source code tuned for some specific "html to email" cases that could be worth incorporating into mjml. The other part of me would not be that surprised if all premailer was doing was calling html2text. Would mjml consider adding something like a new flag "--plaintext" that would give users similar functionality?

Probably not, we want to focus on generating responsive email HTML (which is also why we don't want to add templating language features in MJML).

Also, there are already good solutions for generating text from HTML so we don't want to reinvent the wheel by creating a parser MJML -> Text. An alternative would be to use a tool and do MJML -> HTML -> Text but that defeats the purpose of implementing it in MJML, and you'd be better off doing that using the tool of your choice.

I'll close the issue but feel free to add any comment based on what you end up using and your feedback about the tool you try as it could be helpful for others :).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucasnantonio picture lucasnantonio  Â·  4Comments

ghost picture ghost  Â·  4Comments

liminspace picture liminspace  Â·  3Comments

fmauNeko picture fmauNeko  Â·  3Comments

tobystokes picture tobystokes  Â·  3Comments