domainwidedelegation.comStart free

Use cases → Email operations

Send personalised bulk email with mail merge

Generate and send custom emails to many recipients by merging spreadsheet data with message templates via a service account.

Who it is forOperations, comms, or HR teams sending tailored updates to large internal or external lists.
APIsGmail API, Sheets API
Typical scopesgmail.send, sheets.readonly

The problem

Manually sending hundreds of individualised emails is error-prone and unscalable. Doing it from a user’s mailbox risks throttling, missed personalisation and audit gaps.

How it works

  1. Prepare a Google Sheet with recipient rows and merge fields.
  2. Author an email template with merge tags for personalisation.
  3. Read the sheet data with the service account using Sheets API.
  4. Generate a personalised draft for each row and send via Gmail API as the relevant user.
  5. Log send status per recipient for audit and retries.

What changes

Bulk personalised emails are sent from the correct mailbox, with each message tailored to the recipient’s data.

The trap in this one. If you send using the Gmail API as a delegated user, Gmail’s internal send limits still apply per account, but these are not surfaced via API until you hit them. After ~100-150 sends in rapid succession, API calls start returning 429 or 403 errors, but the failure is per-user and resets after a variable cooldown. Silent partial sends are common: some recipients never receive mail, but the script may not log these without explicit error handling after each send.

Watch it explained

“Ditch Generic Emails! Learn Google Workspace Mail Merge!” — Paul O'Malley on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Can you send attachments with the merged emails?

Yes, but you must base64 encode and attach them for each message. Watch for larger files: Gmail size limits apply and are not always reported clearly in the API response.

How do you avoid duplicate sends if the process is interrupted?

Log message IDs or recipient states after each successful send, and resume only unsent rows on rerun. The Gmail API does not prevent duplicate messages.

Want this built?

This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.

Talk to us Or read the setup guide

Related use cases

Route form and system notifications to a case owner

Parse machine notifications, work out who owns the record, and put it in front of them.

Automate contract renewal reminders via delegated email

Send timely, auditable reminders for contract renewals by scheduling delegated emails from a service account.

Distribute and track mass surveys via Gmail

A delegated service account sends survey invitations to large recipient lists and tracks responses, centralising delivery and engagement data for reporting.