You could always use AlphaMail (disclosure: I'm one of the developers behind it).
Just install with NPM:
npm install alphamail
Sign up for a AlphaMail account. Get a token, and then you can start sending with the AlphaMail service.
var alphamail = require('alphamail');
var emailService = new alphamail.EmailService()
.setServiceUrl('http://api.amail.io/v1/')
.setApiToken('YOUR-ACCOUNT-API-TOKEN-HERE');
var person = {
id: 1234,
userName: "jdoe75",
name: {
first: "John",
last: "Doe"
},
dateOfBirth: 1975
};
emailService.queue(new alphamail.EmailMessagePayload()
.setProjectId(12345) // ID of your AlphaMail project (determines template, options, etc)
.setSender(new alphamail.EmailContact("Sender Company Name", "from@example.com"))
.setReceiver(new alphamail.EmailContact("John Doe", "to@example.org"))
.setBodyObject(person) // Any serializable object
);
And in the AlphaMail GUI (Dashboard) you'll be able to edit the template with the data you sent:
Name: <# payload.name.last " " payload.name.first #>
Date of Birth: <# payload.dateOfBirth #>
<# if (payload.id != null) { #>
Sign Up Free!
<# } else { #>
Sign In
<# } #>
The templates are written in Comlang, it's a simple template language specifically designed for emails.