
Mailgen – Generates clean, responsive HTML for transactional email - eladnava
https://www.npmjs.com/package/mailgen
======
e12e
From the linked templates, it would appear text-part is supported, but from
the examples, it would appear it is not. Email without a text body isn't
really valid email, and it certainly isn't "responsive". Does this library
generate a proper text part automatically? Does it allow disabling the html-
part?

~~~
eladnava
Good point -- this has just been added, thanks for your feedback!
[https://github.com/eladnava/mailgen#plaintext-e-
mails](https://github.com/eladnava/mailgen#plaintext-e-mails)

~~~
brightball
That is very "responsive" of you. :-)

~~~
eladnava
Ha ha =)

------
veeti
Looks very nice. However, I'm not entirely sure why this has to be a language-
specific library instead of just an HTML template to copy?

~~~
alessioalex
If you need the HTML templates to copy you can do so from here:
[https://github.com/wildbit/postmark-
templates](https://github.com/wildbit/postmark-templates)

This project seems to be more specific, targeting Node users.

~~~
danvoell
And here is another one - [https://github.com/mailgun/transactional-email-
templates](https://github.com/mailgun/transactional-email-templates)

------
cyberferret
Nice tip about the X-Entity-Ref-ID usage to prevent GMail from chunking
repeated emails together! I will have to note that for my existing web apps.

Any plans to extend this to use GMail's enhancements allowing a confirmation
button in the subject line, thus letting the user perform a simple action
without opening the actual email?

I see more and more confirmation emails now with the confirm button in the
subject line - I believe it requires a few more header specific to GMail to
allow this.

~~~
quaz3l
I did not know this existed so I looked it up! Here are some docs about it:
[https://developers.google.com/gmail/markup/reference/one-
cli...](https://developers.google.com/gmail/markup/reference/one-click-action)

~~~
cyberferret
That's them. I had a look at these when it first was 'released' by Google, but
back then it was more of an 'opt in' system I believe, with Google having to
approve senders who were going to embed these schemas into their emails.

Have to revisit this now to see if they have relaxed the requirements a
little. It will be good if these became a normal extension to all emails and
other clients such as Outlook, Yahoo Mail etc. all pick it up as a standard.

------
codegeek
In case someone is interested, mailgun offered some free transactional email
templates on their blog back in 2014:

[http://blog.mailgun.com/transactional-html-email-
templates/](http://blog.mailgun.com/transactional-html-email-templates/)

------
jbb555
Well you can generate HTML "email" if you don't want anyone to read it. email
is not html, it's text.

~~~
matthewmacleod
My email inbox, which currently contains almost entirely email in HTML format,
would beg to disagree with you.

I understand the frustration to some extent – many organisations could get by
with using plain text emails rather than HTML ones. But AFAIK HTML emails mean
better customer engagement, and can offer useful features to users. A stick-
in-the-mud "that isn't real email" attitude unfortunately doesn't get us that
far.

~~~
gkya
> But AFAIK HTML emails mean better customer engagement

Or the illusion thereof.

HTML mail is more likely to go into the Junk mailbox. Guess the most usefull
thing with HTML email is the "pixel gif" that you use to track it, and it's
useful only to the sender, not the receiver.

On the other hand, IDK what "useful features" of HTML you talk about, other
than being (relatively, possibly, and never certainly) pretty.

~~~
matthewmacleod
_Or the illusion thereof._

I'm not sure about that. I'm afraid I don't have access to the numbers any
more, but I've seen firsthand how HTML emails can result in more engagement
with customers – more likely to follow links, in particular.

 _HTML mail is more likely to go into the Junk mailbox._

Is that really true? If anything, I've seen that regular customers—assuming
you are not a tech-focused business—are _less_ likely to read emails in plain-
text formats!

 _On the other hand, IDK what "useful features" of HTML you talk about, other
than being (relatively, possibly, and never certainly) pretty._

I don't think that 'pretty' is really fair – more like 'can have visual
design'. If it were the case, surely magazines and newspapers would be nothing
but plain text too, as would all mail we receive. In contrast, I would be a
bit freaked out to receive something like a utility bill in the mail that was
in plain text, without a company logo, or formatting, or other elements that
make it more usable and identifiable.

I do completely understand that you prefer plain-text email, and so do I. But
I'm pretty sure we are in the minority there, and that most people treat email
in the same way as they'd treat physical mail – and that probably means that
the relatively invisible downsides (tracking, size, poor formatting etc.) are
outweighed by being formatted more effectively.

