Apply Gmail Label Rules
applyGmailLabelRules(rules) takes rule objects {query, label, archive}, creates any label that does not exist, applies it to matching…
Apply Gmail Label Rules
applyGmailLabelRules(rules) takes rule objects {query, label, archive}, creates any label that does not exist, applies it to matching…
Get Latest Csv Attachment
A vendor or report tool emails you a CSV every morning. getLatestCsvAttachment(query) searches Gmail, picks the newest .csv attachment from…
Create Drafts From Rows
A sheet of recipients and a template, and a human who still wants to read every email before it goes out. createDraftsFromRows(rows, buildFn…
Send Digest Per Owner
One big “open items” email to the whole team gets ignored. One short email per person, listing only their rows, gets read…
Send Email With Budget
A nightly job that emails 300 people works fine until the day it doesn't, and then it dies halfway through with “Service invoked too many…
Get Unprocessed Threads
Your nightly job pulls vendor receipts out of Gmail into a sheet. Run it twice and you get every receipt twice. getUnprocessedThreads(query…
Email yourself when the nightly job fails
You've got a time-driven sync that "mostly works" until it doesn't — and you find out three days later from a confused teammate. Triggers…
Email Yourself an Error Alert
Nightly jobs that "mostly work" fail quietly until a teammate notices bad data. emailErrorAlert sends you a plain Gmail with the error…
Send an HTML Email with GmailApp
GmailApp.sendEmail can send HTML — you just need htmlBody (and a plain-text fallback for picky clients). This helper wraps the options bag…