domainwidedelegation.comStart free

Use casesAdmin and governance

Send template-based welcome emails to new users automatically

Trigger a consistent, customisable welcome message for each new account, using templates and delegated sending from a real mailbox.

Who it is forIT or onboarding teams automating standard user welcome messages across multiple domains.
APIsAdmin SDK, Gmail API
Typical scopesadmin.directory.user.readonly, gmail.send

The problem

Manual welcome emails are inconsistent and sometimes forgotten, especially at scale or across multiple domains. Automating this with a service account ensures every new user gets the correct information, but only if the process is triggered reliably and messages are sent from the right mailbox.

How it works

  1. Poll the Admin SDK for newly created users at a regular interval.
  2. On detecting a new user, populate a standardised template with user-specific details.
  3. Send the welcome email using the Gmail API, with the service account delegated to the intended sender's mailbox.
  4. Record the sent message ID and user details to prevent duplicate sends.

What changes

Every new user receives a timely, branded welcome email from the correct sender, with no manual intervention required.

The trap in this one. The Admin SDK user list API is eventually consistent—new users may not appear for several minutes, and polling too frequently can miss accounts created and deleted within a short window. This can result in users never receiving a welcome email if your process only checks once or marks as sent based on incomplete data. Always reconcile against a durable log of actually sent emails, not just the user list.

Watch it explained

Build an Automated Email Workflow using Google Apps Script — Part1 | Aryan Irani” — Aryan Irani on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Can I use dynamic content in the welcome template?

Yes, merge user attributes from the Admin SDK into the template before sending. Just ensure you handle missing or unexpected values gracefully.

What if a user is deleted before the email is sent?

The Gmail API will return an error when sending to a non-existent account. Log and surface these errors so you can review missed welcomes.

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

Automate joiners, movers and leavers

Create accounts, set group membership, provision Drive and hand over mailboxes without a manual checklist.

Continuously verify your delegation still works

A scheduled probe that proves every API still answers under every tenant, before a customer finds out otherwise.

Reduce an over-broad delegation grant safely

Find out which scopes your automation genuinely uses, then cut the grant down to them.