diff --git a/index.js b/index.js index e7c8d33..5c64e56 100644 --- a/index.js +++ b/index.js @@ -68,7 +68,7 @@ class SendGridTransport { { let alternatives = source.alternatives.map(entry => { let alternative = { - content: entry.content, + value: entry.content, type: entry.contentType }; return alternative; @@ -91,7 +91,7 @@ class SendGridTransport { case 'watchHtml': { let alternative = { - content: source.watchHtml, + value: source.watchHtml, type: 'text/watch-html' }; msg.content = [].concat(msg.content || []).concat(alternative); @@ -113,14 +113,14 @@ class SendGridTransport { }); if (msg.content && msg.content.length) { - if (msg.text) { - msg.content.unshift({ type: 'text/plain', content: msg.text }); - delete msg.text; - } if (msg.html) { - msg.content.unshift({ type: 'text/html', content: msg.html }); + msg.content.unshift({ type: 'text/html', value: msg.html }); delete msg.html; } + if (msg.text) { + msg.content.unshift({ type: 'text/plain', value: msg.text }); + delete msg.text; + } } sgMail.send(msg, callback);