Automation Email Action: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

Add a send email action to an automation

A send email action's input mapping is internal to Wix, so you generate it rather than build it yourself.

To add a send email action to an automation:

  1. Call Generate Action Input Mapping with the action's settings in action, such as its emailType, notificationTopicId and recipients, and optionally the email content with MJML as its editorType. To email the contact who triggered the automation, set recipients.recipientType to TRIGGER_CONTACT and specify the path of the trigger payload schema property marked with "identityType": "contact" as recipients.triggerContactOptions.contactIdPath. Without recipients, the email goes to the site owner. A BUSINESS_TRANSACTIONAL email needs a transactional notificationTopicId.
  2. Call Create Automation or Update Automation with an APP_DEFINED action whose appDefinedInfo.appId, appDefinedInfo.actionKey and appDefinedInfo.inputMapping are the appId, actionKey and inputMapping from the response. Don't modify the input mapping, and use it for this action only: actions that share an input mapping share their email content, so removing one of them deletes the content the others send. The email content goes live when the automation is activated, and stays a draft until then.
  3. To change the email content later, call Set Email Content with the automation's ID and the action's ID.

Send an automation's email to contacts with a label

An existing automation's email goes to the recipients it was set up with, such as the contact who triggered the automation. You can send it to a group of contacts instead, such as every contact with a VIP label.

To send an automation's email to contacts with a label:

  1. Call Query Automations to find the automation. Save its id and the ID of the APP_DEFINED action whose appDefinedInfo.actionKey is triggered-emails.
  2. Call List Audience Providers and save the id of the provider that selects contacts by label.
  3. Call Update Automation Email Action with the automation and action IDs. In automationEmailAction.recipients, set recipientType to CUSTOM and add an audience to customOptions.audiences with the provider's ID as audienceProviderId and the label IDs in audienceProviderData. Send only recipients, so the action's other settings stay as they are. The email goes to the labeled contacts from the automation's next run.

Edit a preinstalled automation's email content for the first time

A preinstalled automation starts out sharing its email content with every other site running the same automation. To make the content specific to a site, you update it once, which automatically creates the site's own copy.

To edit a preinstalled automation's email content for the first time:

  1. Call Get Email Content for the automation and action. This works even if the site hasn't edited the content yet, and returns the shared, template content.
  2. Change the fields you want to update in the returned content, keeping the rest as retrieved. Set Email Content replaces the stored content in full, so anything left out is cleared rather than kept.
  3. Call Set Email Content with the updated content. This creates the site's own copy of the content and publishes it.

Preview and test email content

To preview and test email content:

  1. Call Preview Email Content for the automation and action, passing a customPayload that represents the data the action would receive when the automation runs. This renders the content as HTML without sending anything.
  2. Review the rendered html and emailSubject in the response.
  3. Call Send Test Email with a toEmail address and the same customPayload, to receive an actual test email rendered with that data.

Assign a sender to a send email action

By default, a send email action uses the site's default sender details, or a Wix-branded fallback if the site has none. To send from a specific sender instead, assign a sender you've already created with the Sender Details API.

To assign a sender to a send email action:

  1. Call List Sender Details to retrieve the site's existing senders. If none of them fit, call Create Sender Details to create a new one.
  2. Call Assign Sender Details for the automation and action, passing the sender details ID.
  3. Call Get Assigned Sender Details to confirm the assignment.

Last updated: 26 October 2026

Did this help?