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

Multiline message html #368

Closed 1Map closed 5 years ago

1Map commented 5 years ago

I have a message locals variable like:

    locals: {
        message: 'Line 1<br>Line 2<br>Line 3'
    }

My PUG is as follow:

    p
        b Message is as follow:
    p
        | #{message}

Problem is that the HTML renders the message as: Line 1<br>Line 2<br>Line 3

but what I want to see is:

Line 1
Line 2
Line 3
niftylettuce commented 5 years ago

Change your pug to be:

    p
        b Message is as follow:
    p
        | !{message}

Note that change from #{message} to !{message}.