13 posts tagged with “gmail”

Send As Alias

sendAsAlias(to, subject, body, opts) sends mail from a Gmail alias after checking GmailApp.getAliases(). If {from} is not on that list, it…

Test Recipient Or

testRecipientOr(realEmail) is a small switch for outgoing mail. When the script property TEST_MODE is on, it returns your address instead of…

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 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…