The Automation Email Action API manages the "send email" actions of a site's automations: their settings, the email each action sends, the sender details assigned to it, and setting up new actions.
With the Automation Email Action API, you can:
Send email actions are configured as part of a site's automation using the Automations V2 API. The action's configuration, its inputMapping, is internal to Wix. To add a new send email action, generate its input mapping with Generate Action Input Mapping and pass it to the Automations V2 API as is.
Generate Action Input Mapping sets up the action's email type, notification topic, recipient and sender, and creates the email content it sends. The content is the content you specify, or the default template's content if you don't specify any. On a multilingual site, the content is stored in the site's primary language, and the other languages start from the default template's content.
Every call creates new email content, so use each generated input mapping for a single action. Don't add it to more than one action: actions that share an input mapping share their email content, and removing one of them deletes the content the others send.
The email content stays a draft while the automation is a draft or inactive, and goes live when the automation is activated. After the action is added, manage its content with Set Email Content and its settings with Update Automation Email Action.
Update Automation Email Action updates only the fields you send. Send a field as null to reset it to its default. Changes apply from the automation's next run, whether the automation is active or not.
A send email action is stored in its automation's configuration. Update Automation Email Action and Assign Sender Details increment the automation's revision, so retrieve the automation again before updating it with the Automations V2 API.
notificationTopicId isn't validated when the action is saved. Make sure the topic exists and matches emailType.
recipients describes who the email is sent to. Its recipientType is one of:
TRIGGER_CONTACT: The contact at triggerContactOptions.contactIdPath in the trigger payload, such as contactId.SITE_OWNER: The site owner. It has no options.CUSTOM: The participants of customOptions.audiences, as defined by the Audience API. Actions set up in the automations builder with other recipients, such as contacts with a label or several recipients at once, are CUSTOM.Updating recipients replaces all the action's recipients. CUSTOM recipients whose single audience is the trigger contact or the site owner are returned as the equivalent TRIGGER_CONTACT or SITE_OWNER recipients.
Each audience's audienceProviderId is validated, but audienceProviderData and triggerContactOptions.contactIdPath aren't checked against what the provider or the trigger payload expects. Make sure they match, since a mismatch isn't reported when the action is saved.
It's important to note the following points before starting to code:
automationId of the automation it belongs to and the actionId of the send email action within that automation. Find these values by retrieving the site's automations with the Automations V2 API and looking for an APP_DEFINED action whose actionKey is triggered-emails.WEB content in composer.composerDataJson is a proprietary structure, and an invalid value can prevent the content from being previewed or sent. To write content from scratch, use the MJML editor type.language selects a single translation of the content. Content structure is shared across languages, so only the text differs between them.triggered-emails, which sends an email when the automation runs.Last updated: 26 October 2026