A Salesforce Marketing Cloud (formerly ExactTarget) transport for Nodemailer.
'use strict';
var nodemailer = require('nodemailer');
var salesforceTransport = require('nodemailer-salesforce-transport');
var transport = nodemailer.createTransport(salesforceTransport({
triggeredSendDefinitionKey: 'triggeredSendDefinitionKey',
auth: {
clientId: 'clientId',
clientSecret: 'clientSecret'
}
}));
transport.sendMail({
from: '[email protected]',
to: '[email protected]',
subject: 'Hello',
html: '<p>How are you?</p>'
}, function(err, info) {
if (err) {
console.error(err);
} else {
console.log(info);
}
});