forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.66k stars 339 forks source link

Ampersand shows as &Amp; in subject #399

Closed davidbarman closed 4 years ago

davidbarman commented 4 years ago

The subject template doesn't seem to accept & characters. If the & character is part of the template file explicitly or passed in a parameter variable it gets translated to &Amp; when the email is sent.

I have been unable to find a work around.

Any insight?

niftylettuce commented 4 years ago

your template engine is rendering it as escaped

for instance, with pug we do this:

!= 'Foo & Bar'

Instead of escaped:

= 'Foo & Bar'