Skip to content

Instantly share code, notes, and snippets.

@Frenchcooc
Created April 7, 2021 20:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frenchcooc/a2d12a7c663c6c432bb03ff3ea67b20d to your computer and use it in GitHub Desktop.
Save Frenchcooc/a2d12a7c663c6c432bb03ff3ea67b20d to your computer and use it in GitHub Desktop.
This gist is part of a blog post about mail merge script for Gmail - https://mailmeteor.com/mail-merge-gmail/script
function sendEmails() {
const recipients = ["sally@mailmeteor.com", "neil@mailmeteor.com"];
const template = {
"subject": "My mail merge script for Gmail",
"content": `Hi,<br><br>
I just wanted to show you how to send emails in bulk with my Gmail account!<br><br>
Take care,<br>
- Corentin<br><br>
PS: <a href="https://mailmeteor.com/mail-merge-gmail/script">Click here to do it by yourself</a>`
}
recipients.forEach(function (recipient) {
MailApp.sendEmail({
to: recipient,
subject: template.subject,
htmlBody: template.content
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment