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

special chars in template #376

Closed ptc-choyzer closed 4 years ago

ptc-choyzer commented 4 years ago

This is my option:

{
            template: `registration/author/templates`,
            message: {
                to: req.email
            },
            locals: {
                host_name: config.content.hostname,
                org_name: req.org_name,
                invitation_url: req.invitation_url,
                support_email: req.support_email,
                locale: req.locale !== undefined ? req.locale : 'en'
            }

And here is my "subject.hbs" template:

{{t 'invitation_to_join'}} {{org_name}} {{t 'on'}} X

When my org_name = "a & b"

I got in the email subject: "a &amp b"

I don't see any way to decode the subject. what I need to do?

ptc-choyzer commented 4 years ago

Fix by using {{{org_name}}} instead {{..}}