> 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

# SendTestEmail

# Package: emails

# Namespace: AutomationEmailActionsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/send-test-email.md

## Permission Scopes:
Manage Email Marketing: SCOPE.DC-PROMOTE.EMAIL-MARKETING

## Introduction

Sends the action's email to a single recipient, so it can be checked in a real inbox.

Placeholders are replaced only by the values in `customPayload`, as in [Preview Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/preview-email-content.md).
One test email is sent, in `language` when given and in the site's primary language otherwise.

The test needs an email content that the site owns: a preinstalled automation
still sharing its template's content has to be updated once before it can be tested.
Reading and previewing it work either way.

There's a rate limit on test emails per action, to prevent excessive sends.

---

## REST API

### Schema

```
 Method: sendTestEmail
 Description: Sends the action's email to a single recipient, so it can be checked in a real inbox.  Placeholders are replaced only by the values in `customPayload`, as in [Preview Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/preview-email-content.md). One test email is sent, in `language` when given and in the site's primary language otherwise.  The test needs an email content that the site owns: a preinstalled automation still sharing its template's content has to be updated once before it can be tested. Reading and previewing it work either way.  There's a rate limit on test emails per action, to prevent excessive sends.
 URL: https://www.wixapis.com/emails-automations/v1/automations/{automationId}/email-actions/{actionId}/email-content/send-test-email
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  toEmail
 Method parameters: 
   param name: customPayload | type: CustomPayload | description: Values to render the email content's placeholders with.  Currently supports at most 1000 values per level, nested up to 10 levels deep.  
    - ONE-OF: 
     - name: placeholders | type: Map | description: Placeholder values, keyed the way the content references them. Values may carry recipient data.  
        - name: variables | type: Map<string,PlaceholderContent> | description: Nested placeholder values keyed by name.  | validation: format map
           - ONE-OF: 
              - name: text | type: PlainText | description: Plain text replacement value.  
                 - name: text | type: string | description: The plain text string.  
              - name: html | type: Html | description: HTML replacement value. Rendered as HTML in supported contexts.  
                 - name: html | type: string | description: The HTML string.  
              - name: money | type: Money | description: Monetary value.  
                 - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
                 - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD).  | validation: format CURRENCY
                 - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative.  
              - name: dateTime | type: DateTime | description: Date and time value.  
                 - name: timestamp | type: string | description: The point in time.  | validation: format date-time
                 - name: timeZone | type: string | description: IANA time zone name (for example, `"Asia/Jerusalem"`). Used to format the date and time for the recipient's locale.  
              - name: map | type: Map | description: Nested map of placeholder values. Used for structured data.  
              - name: array | type: Array | description: List of placeholder values.  
                 - name: items | type: array<PlaceholderContent> | description: Ordered list of placeholder values.  
              - name: enum | type: Enum | description: Enum value with a localized display string.  
                 - name: value | type: string | description: Internal enum identifier.  
                 - name: translation | type: string | description: Localized display string for the enum value.  
              - name: attachment | type: Attachment | description: File attachment with a name and download URL.  
                 - name: fileName | type: string | description: Display name of the attached file.  
                 - name: downloadUrl | type: string | description: URL to download the attached file.  
              - name: integer | type: Integer | description: Integer value.  
                 - name: value | type: integer | description: The integer value.  
              - name: decimal | type: Decimal | description: Decimal (fixed-point) value.  
                 - name: value | type: string | description: The decimal value as a string.  | validation: format DECIMAL_VALUE
              - name: localDate | type: LocalDate | description: Local date value without time or timezone.  
                 - name: value | type: string | description: The local date in `YYYY-MM-DD` format.  | validation: format LOCAL_DATE
     - name: triggerPayload | type: object | description: Data in the format the action receives when the automation runs. Placeholder values are derived from it, so the content can be rendered against real data without knowing which placeholder keys it uses.  
   param name: fromName | type: fromName | description: Sender name shown on the test email. Defaults to the site's sender details.  | validation: maxLength 100
   param name: language | type: language | description: Language to send the test email in. Defaults to the site's primary language.  | validation: format LANGUAGE
   param name: replyToEmail | type: replyToEmail | description: Reply-to address for the test email. Defaults to the site's sender details.  | validation: format EMAIL
   param name: toEmail | type: toEmail | description: Address to send the test email to. | required: true | validation: format EMAIL
 Return type: SendTestEmailResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: LANGUAGE_NOT_CONFIGURED_FOR_SITE | Description: none
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NOT_AN_EMAIL_ACTION | Description: none
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: AUTOMATION_ACTION_NOT_FOUND | Description: none
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CONTENT_NOT_CONFIGURED | Description: none
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: TEST_EMAIL_LIMIT_REACHED | Description: This action has reached the rate limit for test emails.


```

### Examples

### Send Test Email
Send a test email for an automation's send email action to a single recipient.

```curl
curl -X POST \
'https://www.wixapis.com/emails-automations/v1/automations/0029458c-a8e1-4d04-bd88-ad0af11cb678/email-actions/f6f72a5c-77ef-4672-ada1-83aa45de7f2c/email-content/send-test-email' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "toEmail": "test@example.com",
  "customPayload": {
    "placeholders": {
      "variables": {
        "subscriptionName": {
          "text": {
            "text": "Pro Plan"
          }
        },
        "priceUpdateDate": {
          "text": {
            "text": "March 1, 2026"
          }
        },
        "itemUpdatedPrice": {
          "text": {
            "text": "$29.99"
          }
        },
        "cycleType": {
          "text": {
            "text": "month"
          }
        }
      }
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automationsEmailActions.automationEmailAction.sendTestEmail(identifiers, options)
 Description: Sends the action's email to a single recipient, so it can be checked in a real inbox.  Placeholders are replaced only by the values in `customPayload`, as in [Preview Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/preview-email-content.md). One test email is sent, in `language` when given and in the site's primary language otherwise.  The test needs an email content that the site owns: a preinstalled automation still sharing its template's content has to be updated once before it can be tested. Reading and previewing it work either way.  There's a rate limit on test emails per action, to prevent excessive sends.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  identifiers.automationId, identifiers.actionId, options.toEmail, identifiers, options
 Method parameters: 
   param name: identifiers | type: SendTestEmailIdentifiers  none | required: true 
        - name: automationId | type: string | description: GUID of the automation the action belongs to. | required: true | validation: format GUID
        - name: actionId | type: string | description: GUID of the send email action within the automation. | required: true | validation: format GUID
   param name: options | type: SendTestEmailOptions  none | required: true 
        - name: language | type: string | description: Language to send the test email in. Defaults to the site's primary language.  | validation: format LANGUAGE
        - name: toEmail | type: string | description: Address to send the test email to. | required: true | validation: format EMAIL
        - name: customPayload | type: CustomPayload | description: Values to render with. When omitted, placeholders stay unresolved in the test email.  
           - ONE-OF: 
              - name: placeholders | type: Map | description: Placeholder values, keyed the way the content references them. Values may carry recipient data.  
                 - name: variables | type: Map<string,PlaceholderContent> | description: Nested placeholder values keyed by name.  | validation: format map
                    - ONE-OF: 
                       - name: text | type: PlainText | description: Plain text replacement value.  
                          - name: text | type: string | description: The plain text string.  
                       - name: html | type: Html | description: HTML replacement value. Rendered as HTML in supported contexts.  
                          - name: html | type: string | description: The HTML string.  
                       - name: money | type: Money | description: Monetary value.  
                          - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
                          - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD).  | validation: format CURRENCY
                          - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative.  
                       - name: dateTime | type: DateTime | description: Date and time value.  
                          - name: timestamp | type: Date | description: The point in time.  
                          - name: timeZone | type: string | description: IANA time zone name (for example, `"Asia/Jerusalem"`). Used to format the date and time for the recipient's locale.  
                       - name: map | type: Map | description: Nested map of placeholder values. Used for structured data.  
                       - name: array | type: Array | description: List of placeholder values.  
                          - name: items | type: array<PlaceholderContent> | description: Ordered list of placeholder values.  
                       - name: enum | type: Enum | description: Enum value with a localized display string.  
                          - name: value | type: string | description: Internal enum identifier.  
                          - name: translation | type: string | description: Localized display string for the enum value.  
                       - name: attachment | type: Attachment | description: File attachment with a name and download URL.  
                          - name: fileName | type: string | description: Display name of the attached file.  
                          - name: downloadUrl | type: string | description: URL to download the attached file.  
                       - name: integer | type: Integer | description: Integer value.  
                          - name: value | type: integer | description: The integer value.  
                       - name: decimal | type: Decimal | description: Decimal (fixed-point) value.  
                          - name: value | type: string | description: The decimal value as a string.  | validation: format DECIMAL_VALUE
                       - name: localDate | type: LocalDate | description: Local date value without time or timezone.  
                          - name: value | type: string | description: The local date in `YYYY-MM-DD` format.  | validation: format LOCAL_DATE
              - name: triggerPayload | type: object | description: Data in the format the action receives when the automation runs. Placeholder values are derived from it, so the content can be rendered against real data without knowing which placeholder keys it uses.  
        - name: fromName | type: string | description: Sender name shown on the test email. Defaults to the site's sender details.  | validation: maxLength 100
        - name: replyToEmail | type: string | description: Reply-to address for the test email. Defaults to the site's sender details.  | validation: format EMAIL
 Return type: PROMISE<SendTestEmailResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: LANGUAGE_NOT_CONFIGURED_FOR_SITE | Description: none
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NOT_AN_EMAIL_ACTION | Description: none
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: AUTOMATION_ACTION_NOT_FOUND | Description: none
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CONTENT_NOT_CONFIGURED | Description: none
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: TEST_EMAIL_LIMIT_REACHED | Description: This action has reached the rate limit for test emails.


```

### Examples

### Send test email
Send a test email for an automation's send email action to a single recipient.

```javascript
import { automationEmailAction } from "@wix/automations-email-actions";

async function sendTestEmail() {
  const response = await automationEmailAction.sendTestEmail(
    {
      automationId: "0029458c-a8e1-4d04-bd88-ad0af11cb678",
      actionId: "f6f72a5c-77ef-4672-ada1-83aa45de7f2c",
    },
    {
      toEmail: "test@example.com",
      customPayload: {
        placeholders: {
          variables: {
            subscriptionName: { text: { text: "Pro Plan" } },
            priceUpdateDate: { text: { text: "March 1, 2026" } },
            itemUpdatedPrice: { text: { text: "$29.99" } },
            cycleType: { text: { text: "month" } },
          },
        },
      },
    },
  );
}

/* Promise resolves to: {} */

```

### sendTestEmail (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { automationEmailAction } from '@wix/automations-email-actions';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { automationEmailAction },
  // Include the auth strategy and host as relevant
});


async function sendTestEmail(identifiers,options) {
  const response = await myWixClient.automationEmailAction.sendTestEmail(identifiers,options);
};
```

---