> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/introduction.md

## Article Content:

# About the Automation Email Action API

The Automation Email Action API manages the email content of a "send email" action within a site's automation: the subject line, preview text, and editor content sent when the action runs.

With the Automation Email Action API, you can:

- Retrieve and update a send email action's email content.
- Preview the rendered email content without sending it.
- Send a test email to check how the content looks in a real inbox.

Send email actions are configured as part of a site's automation using the [Automations V2 API](https://dev.wix.com/docs/api-reference/business-management/automations/automations/automations-v2/introduction.md). The Automation Email Action API manages an existing action's email content only. It doesn't create the action itself.

## Before you begin

It's important to note the following points before starting to code:

- An action's content isn't identified by an ID of its own. Address it by the `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`.
- A preinstalled automation starts out sharing its email content with every other site running the same automation. [Get Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/get-email-content.md) and [Preview Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/preview-email-content.md) serve this shared content until a site edits it. [Send Test Email](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/send-test-email.md) requires content the site owns, so update it once first.
- [Set Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/set-email-content.md) replaces the stored content in full. The most reliable way to make a change is to first call [Get Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/get-email-content.md) and modify the result, rather than building the content from scratch. This matters especially for `composer.composerDataJson`, a proprietary structure: an invalid value can prevent the content from being previewed or sent.
- On a multilingual site, `language` selects a single translation of the content. Content structure is shared across languages, so only the text differs between them.

## Use cases

- [Edit a preinstalled automation's email content for the first time](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/sample-flows.md#edit-a-preinstalled-automations-email-content-for-the-first-time)
- [Preview and test email content before it goes live](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/sample-flows.md#preview-and-test-email-content)

## Terminology

- **Automation**: A workflow, configured with the [Automations V2 API](https://dev.wix.com/docs/api-reference/business-management/automations/automations/automations-v2/introduction.md), that runs a set of actions when a trigger occurs.
- **Send email action**: An automation action whose action key is `triggered-emails`, which sends an email when the automation runs.
- **Preinstalled automation**: An automation added to every site that installs the app that created it, rather than being specific to a single site.

@sdk_package_setup