Send an Email with html & css

This is a simple flow to send a formatted email using the template node

[{"id":"9e2b7dd1.4e5ce","type":"e-mail","z":"b10ae1fa.10392","server":"smtp.mail.eu-west-1.awsapps.com","port":"465","secure":true,"tls":true,"name":"","dname":"Send Email","x":730,"y":160,"wires":[]},{"id":"9953d63b.3ddff8","type":"function","z":"b10ae1fa.10392","name":"Transactional Emails","func":"\nmsg={\n    payload:msg.payload,\n    topic:\"Tekos Flow\",\n    to:msg.instance.login\n   \n};\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520.000057220459,"y":162.9999942779541,"wires":[["9e2b7dd1.4e5ce"]]},{"id":"b6a21363.fed41","type":"template","z":"b10ae1fa.10392","name":"html","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<head>\n    <style>\n        {{payload}}\n    </style>\n</head>\n\n\n<body>\n    <p>Hi, and welcome to Tekos Flow,</p>\n    <p>Here are you crendentials:</p>\n    <p>Flow url : https://{{subdomain}}.tekos.co</p>\n    <p>Login : {{instance.login}}</p>\n    <p>Password : {{instance.password}}</p>\n    <p>&nbsp;</p>\n    <p>Tekos Team</p>\n </body>","x":327.00008392333984,"y":159.9999942779541,"wires":[["9953d63b.3ddff8"]]},{"id":"a4769117.6a10a","type":"template","z":"b10ae1fa.10392","name":"css","field":"payload.style","fieldType":"msg","format":"html","syntax":"mustache","template":"\n.logo {\nwith:30%;\nheight:30%;\n}\n.votrev{\n    font-size: 40px;\n    font-family: sans-serif;\n    color: #1E9F0D;\n}\n\n/* Hover cell effect! */","x":203.0000762939453,"y":161.9999942779541,"wires":[["b6a21363.fed41"]]}]

Flow Info

Created 4 years, 10 months ago
Rating:

Owner

Actions

Rate:

Node Types

Core
  • function (x1)
  • template (x2)
Other
  • e-mail (x1)

Tags

  • email
  • css
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option