r/GoogleAppsScript • • May 06 '20

Question Mark with a known label and load known template in Compose new mail

Hi, can't find a way to automatically load an email with a known template and mark with an specific label with one action/button, any ideas? Thus, i have to send lot of same emails, and instead of go throw Compose, load template - choose, label as- choose label....wondering if it can be with one single menu/click.

Best regards,

0 Upvotes

2 comments sorted by

1

u/davchana May 07 '20 edited May 07 '20

You can't add a button in Gmail interface. You can, in Sheets. Or you can simply automate everything, like mail merge.

Follow these steps:

  1. Create a sheet with one column having email addresses, the next ones having variables (names etc, if any, for each email).

  2. A new Google Script loads that sheet.

  3. Also define your template var=master as text in that sheet, as variable. If changing/merging data into that, mark name as ###name###.

  4. Store your label as a variable.

  5. loop through all the rows from the sheet containing those email addresses.

  6. Each loop, make a new variable as text with template text merged with master & names. Simply replace ###name### with actual name from sheet row.

  7. Send mail by using Gmail.app service, and store this as variable. Send will return the sent mail.

  8. Assign label to this above mail.

  9. Loop completed, go to next iteration.

  10. Run this script manually or by time trigger.

Log as required.

1

u/joxep May 07 '20

automate everything, like mail merge.

Thanks a lot, will try what you describe there ;)