Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mb8z/b0c96fa65f3f193e2ea833c742bd15c0 to your computer and use it in GitHub Desktop.
Save mb8z/b0c96fa65f3f193e2ea833c742bd15c0 to your computer and use it in GitHub Desktop.
Sending an email to multiple recipients with variables
const { Emails } = require('automagically');
const send = async () => {
const email = Emails.send({
from: { email: '[email protected]', name: 'AwesomeApp' },
to: [
{ email: '[email protected]', name: 'John Doe', age: 20 },
{ email: '[email protected]', name: 'Foo Bar', age: 30 },
],
subject: 'Welcome {{name}} – it\'s your birthday!',
text: 'Wishing you all the best at your {{age}}th birthday!',
});
};
send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment