mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add support for separate plaintext in outgoing mails (#788)
* Add support for separate plaintext in outgoing mails * Rename msg.plain to msg.plaintext
This commit is contained in:
committed by
GitHub
parent
ef8d5bd8ee
commit
4697636055
@@ -119,7 +119,13 @@ module.exports = function(RED) {
|
||||
else {
|
||||
var payload = RED.util.ensureString(msg.payload);
|
||||
sendopts.text = payload; // plaintext body
|
||||
if (/<[a-z][\s\S]*>/i.test(payload)) { sendopts.html = payload; } // html body
|
||||
if (/<[a-z][\s\S]*>/i.test(payload)) {
|
||||
sendopts.html = payload; // html body
|
||||
if (msg.hasOwnProperty("plaintext")) {
|
||||
var plaintext = RED.util.ensureString(msg.plaintext);
|
||||
sendopts.text = plaintext; // plaintext body - specific plaintext version
|
||||
}
|
||||
}
|
||||
if (msg.attachments && Array.isArray(msg.attachments)) {
|
||||
sendopts.attachments = msg.attachments;
|
||||
for (var a=0; a < sendopts.attachments.length; a++) {
|
||||
|
Reference in New Issue
Block a user