Created
April 7, 2023 15:49
-
-
Save St3ph-fr/fa12aff2d6a51582eabbd17392ff4cf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Send a newsletter or any emails to multiple users easily, no need to use bcc | |
* If you are a workspace user with license > Business Standard you already have the multi-send | |
* https://support.google.com/google-workspace-individual/answer/11243118 | |
*/ | |
function sendMyNewsletter() { | |
let emails = 'COMA_SEPARATED_LIST_OF_EMAILS_NO_SPACE' | |
let subject = 'SUBJECT OF THE EMAILS IN YOUR DRAFT'; | |
let draft = GmailApp.getDraftMessages().find(message => { return message.getSubject() == subject }); | |
if(!draft){console.log('No draft found');return ;} | |
emails.split(',').forEach(email => { | |
GmailApp.sendEmail(email, draft.getSubject(), draft.getPlainBody(), { | |
"from": draft.getFrom(), | |
"htmlBody": draft.getBody() }); | |
console.log('Email sent to : '+email); }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment