> 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

# GenerateActionInputMapping

# Package: emails

# Namespace: AutomationEmailActionsService

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

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

## Introduction

Generates the input mapping of a new send email action, along with the email content it sends.

Use the response to add a send email action to an automation with the [Automations V2 API](https://dev.wix.com/docs/api-reference/business-management/automations/automations/automations-v2/introduction.md):
set `appDefinedInfo.appId`, `appDefinedInfo.actionKey` and `appDefinedInfo.inputMapping` from `appId`, `actionKey`
and `inputMapping`. Once the action is added, manage its email content with
[Set Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/set-email-content.md).

`inputMapping` is an opaque structure: pass it as is, rather than building or modifying it.

The action is set up as described by `action`, and anything it leaves out gets the same value the automations
builder gives a new send email action. The email content is `content` when given, and the default template's
content otherwise. The content stays a draft while the automation is a draft or inactive, and goes live when the
automation is activated.

Every call creates new email content, so generate an input mapping when you're about to add the action. Use each
input mapping for a single action only, and don't add it to more than one action, in the same automation or in
different ones. Actions that share an input mapping share their email content: updating it through one action
changes the email of all of them, and removing one of them deletes the content the others send.

`content` is checked like in Set Email Content, and rejected with `CONTENT_NOT_PUBLISHABLE` when it isn't
publishable. On a multilingual site, `content` is stored in the site's primary language only, other languages
start from the default template's content, and `content.editorType` can't change the default template's format.

---

## REST API

### Schema

```
 Method: generateActionInputMapping
 Description: Generates the input mapping of a new send email action, along with the email content it sends.  Use the response to add a send email action to an automation with the [Automations V2 API](https://dev.wix.com/docs/api-reference/business-management/automations/automations/automations-v2/introduction.md): set `appDefinedInfo.appId`, `appDefinedInfo.actionKey` and `appDefinedInfo.inputMapping` from `appId`, `actionKey` and `inputMapping`. Once the action is added, manage its email content with [Set Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/set-email-content.md).  `inputMapping` is an opaque structure: pass it as is, rather than building or modifying it.  The action is set up as described by `action`, and anything it leaves out gets the same value the automations builder gives a new send email action. The email content is `content` when given, and the default template's content otherwise. The content stays a draft while the automation is a draft or inactive, and goes live when the automation is activated.  Every call creates new email content, so generate an input mapping when you're about to add the action. Use each input mapping for a single action only, and don't add it to more than one action, in the same automation or in different ones. Actions that share an input mapping share their email content: updating it through one action changes the email of all of them, and removing one of them deletes the content the others send.  `content` is checked like in Set Email Content, and rejected with `CONTENT_NOT_PUBLISHABLE` when it isn't publishable. On a multilingual site, `content` is stored in the site's primary language only, other languages start from the default template's content, and `content.editorType` can't change the default template's format.
 URL: https://www.wixapis.com/emails-automations/v1/automations/email-actions/generate-input-mapping
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  content.emailSubject, content.composer, content.composer.composerDataJson
 Method parameters: 
   param name: action | type: AutomationEmailAction | description: An automation email action represents the email sent by an automation's `triggered-emails` action: its type, recipient and sender. The email content is managed separately, with [Get Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/get-email-content.md) and [Set Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/set-email-content.md).  An action isn't identified by an GUID of its own. An existing action is addressed together with the automation it belongs to, and a new one is described before it's added to an automation, so it has no identifiers yet.  
        - name: emailType | type: EmailType | description: Type of the email, which determines whether contacts can unsubscribe from it.  Default: `PROMOTIONAL`  
             - enum:
             -     PROMOTIONAL: Marketing email. Sent only to contacts subscribed to marketing, who can unsubscribe from its notification topic.
             -     BUSINESS_TRANSACTIONAL: Email about the contact's activity with the business, such as an order confirmation. Contacts can unsubscribe from its notification topic.
             -     BUSINESS_CRITICAL: Email contacts must receive, such as a password reset. Sent to every contact, including unsubscribed ones.
        - name: notificationTopicId | type: string | description: GUGUID of the notification topic contacts unsubscribe from to stop receiving the email.  - `PROMOTIONAL`: A promotional topic. - `BUSINESS_TRANSACTIONAL`: A transactional topic.  Required if `emailType` is `BUSINESS_TRANSACTIONAL`. Can't be specified if `emailType` is `BUSINESS_CRITICAL`, since contacts can't unsubscribe from these emails.  Default: For a `PROMOTIONAL` email, the general promotional topic.  | validation: format GUID
        - name: triggerSchemaContactIdPath | type: string | description: Path in the trigger payload schema to the GUGUID of the contact to send the email to. For example, `contactId` or `contact.id`. Usually the property marked with `"identityType": "contact"`.  Supports a path of property names and array indexes, such as `items[0].contactId`, rather than an expression.  Default: The site owner.  | validation: maxLength 200
        - name: senderDetailsId | type: string | description: GUGUID of the sender details to send the email with, as in [Assign Sender Details](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/assign-sender-details.md).  Default: The site's default sender details if they exist, and Wix-branded sender details otherwise.  | validation: format GUID
   param name: content | type: AutomationEmailContent | description: Email content of a send email action.  
        - name: emailSubject | type: string | description: Subject line displayed in recipients' inboxes. | required: true | validation: maxLength 1000
        - name: emailPreheader | type: string | description: Short preview text shown after the subject line in some email clients.  | validation: maxLength 1000
        - name: composer | type: Composer | description: Editor content and placeholder fallback values, using the canonical Email Marketing [Composer](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/update-composer.md) contract.  Supports a `composer.composerDataJson` of up to 2,000,000 bytes when UTF-8 encoded. | required: true 
           - name: composerDataJson | type: string | description: Editor content for the campaign. The format depends on `campaignEditorType`:  - `WEB`: Wix proprietary JSON format used by the drag-and-drop email editor. - `MOBILE`: A subset of the `WEB` format, used by the mobile email editor. - `MJML`: MJML markup wrapped in a JSON object under key "mjml". - `HTML`: HTML code wrapped in a JSON object under key "html".  Passing the wrong format for the given `campaignEditorType` causes a silent failure when sending or previewing the campaign. | required: true | validation: maxLength 10000000
           - name: defaultValues | type: DefaultValues | description: Fallback values for dynamic placeholders in the campaign content.  
              - name: map | type: object | description: Map of placeholder keys to their default values.  | validation: maxItems 500, format map
        - name: editorType | type: Enum | description: Editor type that produced `composer.composerDataJson`, and therefore the format that field is in. Set it whenever the content being written is in a different format than what is stored. The content is rendered according to this type, so a mismatch fails silently when previewing or sending. Leaving it unset on update keeps the existing type.  Supports `WEB`, `MJML` and `HTML`. To write content from scratch, use `MJML`: `WEB` content is a proprietary structure.  The type can be changed only on an email whose content is in the default language alone, since all of an email's languages share one format.  
             - enum:
             -     WEB: Wix classic drag-and-drop email editor. The `composerDataJson` is stored in Wix proprietary JSON format.
             -     MOBILE: Wix classic mobile-optimized email editor. The `composerDataJson` is stored in a subset of the `WEB` format.
             -     MJML: AI-powered email editor. The `composerDataJson` is stored in MJML markup wrapped in JSON.
             -     HTML: HTML email editor. The `composerDataJson` is stored in raw HTML code wrapped in JSON.
 Return type: GenerateActionInputMappingResponse
  - name: inputMapping | type: object | description: Input mapping of the send email action. Pass it as `appDefinedInfo.inputMapping` without modifying it.  
  - name: appId | type: string | description: GUGUID of the app that defines the send email action. Pass it as `appDefinedInfo.appId`.  | validation: format GUID
  - name: actionKey | type: string | description: Key of the send email action. Pass it as `appDefinedInfo.actionKey`.  | validation: maxLength 100

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: CONTENT_NOT_PUBLISHABLE | Description: none
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NOTIFICATION_TOPIC_REQUIRED | Description: `action.notificationTopicId` is missing for a `BUSINESS_TRANSACTIONAL` email, which needs a transactional topic to unsubscribe from.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NOTIFICATION_TOPIC_NOT_SUPPORTED | Description: `action.notificationTopicId` can't be specified for a `BUSINESS_CRITICAL` email, which contacts can't unsubscribe from.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CONTACT_ID_PATH | Description: `action.triggerSchemaContactIdPath` isn't a payload path. Specify a path of property names, such as `contactId` or `contact.id`, rather than an expression.


```

### Examples

### Generate Action Input Mapping
Generate the input mapping of a new send email action that emails the contact who triggered the automation.

```curl
curl -X POST \
'https://www.wixapis.com/emails-automations/v1/automations/email-actions/generate-input-mapping' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "action": {
    "emailType": "PROMOTIONAL",
    "triggerSchemaContactIdPath": "contact.id"
  },
  "content": {
    "emailSubject": "Thanks for joining, ${contact.name.first}!",
    "composer": {
      "composerDataJson": "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>Welcome aboard!</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
    },
    "editorType": "MJML"
  }
}'
```

### Generate Action Input Mapping for a transactional email
Generate the input mapping of a new `BUSINESS_TRANSACTIONAL` send email action, which needs a transactional `notificationTopicId`.

```curl
curl -X POST \
'https://www.wixapis.com/emails-automations/v1/automations/email-actions/generate-input-mapping' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "action": {
    "emailType": "BUSINESS_TRANSACTIONAL",
    "notificationTopicId": "7c993cf8-6465-4118-a47e-7db482f2f746",
    "triggerSchemaContactIdPath": "contactId"
  },
  "content": {
    "emailSubject": "Order ${order.number} is confirmed",
    "composer": {
      "composerDataJson": "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>Thanks for your order!</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
    },
    "editorType": "MJML"
  }
}'
```

### Generate Action Input Mapping to email the site owner
Generate the input mapping of a new send email action that emails the site owner, since no `triggerSchemaContactIdPath` is given.

```curl
curl -X POST \
'https://www.wixapis.com/emails-automations/v1/automations/email-actions/generate-input-mapping' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "content": {
    "emailSubject": "You have a new sign-up",
    "composer": {
      "composerDataJson": "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>A new member just signed up to your site.</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
    },
    "editorType": "MJML"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automationsEmailActions.automationEmailAction.generateActionInputMapping(options)
 Description: Generates the input mapping of a new send email action, along with the email content it sends.  Use the response to add a send email action to an automation with the [Automations V2 API](https://dev.wix.com/docs/api-reference/business-management/automations/automations/automations-v2/introduction.md): set `appDefinedInfo.appId`, `appDefinedInfo.actionKey` and `appDefinedInfo.inputMapping` from `appId`, `actionKey` and `inputMapping`. Once the action is added, manage its email content with [Set Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/set-email-content.md).  `inputMapping` is an opaque structure: pass it as is, rather than building or modifying it.  The action is set up as described by `action`, and anything it leaves out gets the same value the automations builder gives a new send email action. The email content is `content` when given, and the default template's content otherwise. The content stays a draft while the automation is a draft or inactive, and goes live when the automation is activated.  Every call creates new email content, so generate an input mapping when you're about to add the action. Use each input mapping for a single action only, and don't add it to more than one action, in the same automation or in different ones. Actions that share an input mapping share their email content: updating it through one action changes the email of all of them, and removing one of them deletes the content the others send.  `content` is checked like in Set Email Content, and rejected with `CONTENT_NOT_PUBLISHABLE` when it isn't publishable. On a multilingual site, `content` is stored in the site's primary language only, other languages start from the default template's content, and `content.editorType` can't change the default template's format.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.content.emailSubject, options.content.composer, options.content.composer.composerDataJson
 Method parameters: 
   param name: options | type: GenerateActionInputMappingOptions  none  
        - name: action | type: AutomationEmailAction | description: Settings of the new send email action.  
           - name: emailType | type: EmailType | description: Type of the email, which determines whether contacts can unsubscribe from it.  Default: `PROMOTIONAL`  
                 - enum:
                 -     PROMOTIONAL: Marketing email. Sent only to contacts subscribed to marketing, who can unsubscribe from its notification topic.
                 -     BUSINESS_TRANSACTIONAL: Email about the contact's activity with the business, such as an order confirmation. Contacts can unsubscribe from its notification topic.
                 -     BUSINESS_CRITICAL: Email contacts must receive, such as a password reset. Sent to every contact, including unsubscribed ones.
           - name: notificationTopicId | type: string | description: GUGUID of the notification topic contacts unsubscribe from to stop receiving the email.  - `PROMOTIONAL`: A promotional topic. - `BUSINESS_TRANSACTIONAL`: A transactional topic.  Required if `emailType` is `BUSINESS_TRANSACTIONAL`. Can't be specified if `emailType` is `BUSINESS_CRITICAL`, since contacts can't unsubscribe from these emails.  Default: For a `PROMOTIONAL` email, the general promotional topic.  | validation: format GUID
           - name: triggerSchemaContactIdPath | type: string | description: Path in the trigger payload schema to the GUGUID of the contact to send the email to. For example, `contactId` or `contact.id`. Usually the property marked with `"identityType": "contact"`.  Supports a path of property names and array indexes, such as `items[0].contactId`, rather than an expression.  Default: The site owner.  | validation: maxLength 200
           - name: senderDetailsId | type: string | description: GUGUID of the sender details to send the email with, as in [Assign Sender Details](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/assign-sender-details.md).  Default: The site's default sender details if they exist, and Wix-branded sender details otherwise.  | validation: format GUID
        - name: content | type: AutomationEmailContent | description: Email content to send, using the same contract as [Set Email Content](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/automation-email-action/set-email-content.md).  Stored in the site's primary language. On a multilingual site, other languages start from the default template.  Default: The default template's content.  
           - name: emailSubject | type: string | description: Subject line displayed in recipients' inboxes. | required: true | validation: maxLength 1000
           - name: emailPreheader | type: string | description: Short preview text shown after the subject line in some email clients.  | validation: maxLength 1000
           - name: composer | type: Composer | description: Editor content and placeholder fallback values, using the canonical Email Marketing [Composer](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/update-composer.md) contract.  Supports a `composer.composerDataJson` of up to 2,000,000 bytes when UTF-8 encoded. | required: true 
              - name: composerDataJson | type: string | description: Editor content for the campaign. The format depends on `campaignEditorType`:  - `WEB`: Wix proprietary JSON format used by the drag-and-drop email editor. - `MOBILE`: A subset of the `WEB` format, used by the mobile email editor. - `MJML`: MJML markup wrapped in a JSON object under key "mjml". - `HTML`: HTML code wrapped in a JSON object under key "html".  Passing the wrong format for the given `campaignEditorType` causes a silent failure when sending or previewing the campaign. | required: true | validation: maxLength 10000000
              - name: defaultValues | type: DefaultValues | description: Fallback values for dynamic placeholders in the campaign content.  
                 - name: map | type: object | description: Map of placeholder keys to their default values.  | validation: maxItems 500, format map
           - name: editorType | type: Enum | description: Editor type that produced `composer.composerDataJson`, and therefore the format that field is in. Set it whenever the content being written is in a different format than what is stored. The content is rendered according to this type, so a mismatch fails silently when previewing or sending. Leaving it unset on update keeps the existing type.  Supports `WEB`, `MJML` and `HTML`. To write content from scratch, use `MJML`: `WEB` content is a proprietary structure.  The type can be changed only on an email whose content is in the default language alone, since all of an email's languages share one format.  
                 - enum:
                 -     WEB: Wix classic drag-and-drop email editor. The `composerDataJson` is stored in Wix proprietary JSON format.
                 -     MOBILE: Wix classic mobile-optimized email editor. The `composerDataJson` is stored in a subset of the `WEB` format.
                 -     MJML: AI-powered email editor. The `composerDataJson` is stored in MJML markup wrapped in JSON.
                 -     HTML: HTML email editor. The `composerDataJson` is stored in raw HTML code wrapped in JSON.
 Return type: PROMISE<GenerateActionInputMappingResponse>
  - name: inputMapping | type: object | description: Input mapping of the send email action. Pass it as `appDefinedInfo.inputMapping` without modifying it.  
  - name: appId | type: string | description: GUGUID of the app that defines the send email action. Pass it as `appDefinedInfo.appId`.  | validation: format GUID
  - name: actionKey | type: string | description: Key of the send email action. Pass it as `appDefinedInfo.actionKey`.  | validation: maxLength 100

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: CONTENT_NOT_PUBLISHABLE | Description: none
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NOTIFICATION_TOPIC_REQUIRED | Description: `action.notificationTopicId` is missing for a `BUSINESS_TRANSACTIONAL` email, which needs a transactional topic to unsubscribe from.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NOTIFICATION_TOPIC_NOT_SUPPORTED | Description: `action.notificationTopicId` can't be specified for a `BUSINESS_CRITICAL` email, which contacts can't unsubscribe from.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CONTACT_ID_PATH | Description: `action.triggerSchemaContactIdPath` isn't a payload path. Specify a path of property names, such as `contactId` or `contact.id`, rather than an expression.


```

### Examples

### Generate action input mapping for a transactional email
Generate the input mapping of a new `BUSINESS_TRANSACTIONAL` send email action, which needs a transactional `notificationTopicId`.

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

async function generateActionInputMapping() {
  const response = await automationEmailAction.generateActionInputMapping({
    action: {
      emailType: "BUSINESS_TRANSACTIONAL",
      notificationTopicId: "7c993cf8-6465-4118-a47e-7db482f2f746",
      triggerSchemaContactIdPath: "contactId"
    },
    content: {
      emailSubject: "Order ${order.number} is confirmed",
      composer: {
        composerDataJson: "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>Thanks for your order!</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
      },
      editorType: "MJML"
    }
  });
}

/* Promise resolves to:
 * {
 *   "inputMapping": {
 *     "messageId": "5e2b9f1a-7c4d-4a86-9e3f-1b6d8c0a4f27",
 *     "actionConfigVersion": "V3",
 *     "transactional": true,
 *     "contactId": "{{var(\"contactId\")}}",
 *     "selectedAudience": {
 *       "triggerContactExcluded": true,
 *       "audienceSelectors": [
 *         {
 *           "providerId": "explicitData_triggerMainContact",
 *           "audienceParams": {
 *             "participants": [
 *               {
 *                 "type": "CONTACT",
 *                 "value": "{{var(\"contactId\")}}"
 *               }
 *             ]
 *           }
 *         }
 *       ]
 *     },
 *     "notificationTopicId": "7c993cf8-6465-4118-a47e-7db482f2f746",
 *     "dynamicParams": ["{{var(\"order.number\")}}"]
 *   },
 *   "appId": "135c3d92-0fea-1f9d-2ba5-2a1dfb04297e",
 *   "actionKey": "triggered-emails"
 * }
 */

```

### Generate action input mapping to email the site owner
Generate the input mapping of a new send email action that emails the site owner, since no `triggerSchemaContactIdPath` is given.

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

async function generateActionInputMapping() {
  const response = await automationEmailAction.generateActionInputMapping({
    content: {
      emailSubject: "You have a new sign-up",
      composer: {
        composerDataJson: "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>A new member just signed up to your site.</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
      },
      editorType: "MJML"
    }
  });
}

/* Promise resolves to:
 * {
 *   "inputMapping": {
 *     "messageId": "8a1d4c7e-2f6b-4e93-b5a0-9c3e7d1f2b64",
 *     "actionConfigVersion": "V3",
 *     "selectedAudience": {
 *       "triggerContactExcluded": true,
 *       "audienceSelectors": [
 *         {
 *           "providerId": "d99def6a-5526-4da0-86af-9d2b97b919fc_CollaboratorRoles",
 *           "audienceParams": {
 *             "roleIds": ["6601492336091027458"]
 *           }
 *         }
 *       ]
 *     },
 *     "notificationTopicId": "002195b2-8396-44dd-85d3-b89839f70982"
 *   },
 *   "appId": "135c3d92-0fea-1f9d-2ba5-2a1dfb04297e",
 *   "actionKey": "triggered-emails"
 * }
 */

```

### Generate action input mapping
Generate the input mapping of a new send email action that emails the contact who triggered the automation.

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

async function generateActionInputMapping() {
  const response = await automationEmailAction.generateActionInputMapping({
    action: {
      emailType: "PROMOTIONAL",
      triggerSchemaContactIdPath: "contact.id"
    },
    content: {
      emailSubject: "Thanks for joining, ${contact.name.first}!",
      composer: {
        composerDataJson: "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>Welcome aboard!</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
      },
      editorType: "MJML"
    }
  });
}

/* Promise resolves to:
 * {
 *   "inputMapping": {
 *     "messageId": "3f6c2a1e-8b4d-4e7a-9c2b-1d5e6f7a8b9c",
 *     "actionConfigVersion": "V3",
 *     "contactId": "{{var(\"contact.id\")}}",
 *     "selectedAudience": {
 *       "triggerContactExcluded": true,
 *       "audienceSelectors": [
 *         {
 *           "providerId": "explicitData_triggerMainContact",
 *           "audienceParams": {
 *             "participants": [
 *               {
 *                 "type": "CONTACT",
 *                 "value": "{{var(\"contact.id\")}}"
 *               }
 *             ]
 *           }
 *         }
 *       ]
 *     },
 *     "notificationTopicId": "002195b2-8396-44dd-85d3-b89839f70982",
 *     "dynamicParams": ["{{var(\"contact.name.first\")}}"]
 *   },
 *   "appId": "135c3d92-0fea-1f9d-2ba5-2a1dfb04297e",
 *   "actionKey": "triggered-emails"
 * }
 */

```

### generateActionInputMapping (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 generateActionInputMapping(options) {
  const response = await myWixClient.automationEmailAction.generateActionInputMapping(options);
};
```

---