gmail.onEmailSent handles messages sent from the connected mailbox.
Trigger data matches Get message, including headers, message bodies, labels, and attachment File objects.
Example
automations/track-sent-email.automation.ts
Options
Call
gmail.onEmailSent() without options to use the project binding. The watched account can’t change at runtime.
Trigger data
ReturnsSignal<Message> for each qualifying message. See Get message for all fields.
Behavior
- Only messages newly added to Gmail’s
SENTcollection qualify. Existing sent messages aren’t replayed when you deploy the trigger. - The parsed
from.addressmust match the watched mailbox. A different send-as alias doesn’t qualify. - An authenticated Automate.ax message doesn’t wake the automation that sent it. Other automations watching the mailbox still receive the event.
- Gmail message IDs provide idempotency, so repeated notifications for the same sent message don’t create duplicate events.