> 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

# Package: emails

# Namespace: emailTransmissionV1

# Webhook link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-transmission-v1/email-transmission-updated.md

## Introduction

Triggered when an email transmission is updated.

---

## REST API

### Schema

```
Webhook: Email Transmission Updated
Description: Triggered when an email transmission is updated.
Event body:
 - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events.
 - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event.
 - name: slug | type: string | description: Event name.
 - name: entityId | type: string | description: ID of the entity associated with the event.
 - name: eventTime | type: string (date-time) | description: Event timestamp.
 - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR.
 - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
 - name: updatedEvent | type: object | description: Updated event details.
    - name: currentEntity | type: EmailTransmission | description: The entity after the update.
        - ONE-OF:
           - name: marketingOptions | type: MarketingOptions | description: Options for marketing emails.  Used only when `type` is `MARKETING`.
              - name: unsubscribeUrlPlaceholder | type: string | description: Placeholder in `emailHtmlContent` that gets replaced with a recipient-specific unsubscribe URL before the email is sent. Case-sensitive. For example, `{{unsubscribe_url}}` or `[UNSUBSCRIBE_URL]`. The placeholder must be unique within the HTML content.  If not set, an unsubscribe link in the site's default language is appended to the bottom of the email.
        - name: id | type: string | description: Email transmission GUID.
        - name: createdDate | type: string | description: Date and time the email transmission was created.
        - name: updatedDate | type: string | description: Date and time the email transmission was last updated.
        - name: revision | type: string | description: Revision number, which increments by 1 each time the email transmission is updated.
        - name: emailSubject | type: string | description: Subject line of the email.  Default: None (email is sent without a subject line).
        - name: emailHtmlContent | type: string | description: Full HTML content of the email.  Not returned in `queryEmailTransmissions`. Use `getEmailTransmission` to retrieve the HTML content of a specific transmission.  Stored for 30 days after the transmission is created. After that, this field returns `"<expired>"`.
        - name: metadata | type: object | description: Custom key-value pairs attached to the transmission to identify the context in which the email was sent. These values are passed to the email service provider and included in domain event payloads. Keys and values support alphanumeric characters only (letters and numbers, no spaces or special characters).  Default: `{}`
        - name: senderName | type: string | description: Display name shown as the sender.  Default: None (no display name is set).
        - name: senderEmailAddress | type: string | description: Sender email address. Must be verified using the Sender Emails API before use.  If the provided address can't be used as a FROM address (for example, addresses from free email providers such as gmail.com), the email is sent from `no-reply@wixsitemail.com` and the provided address is automatically used as the reply-to address instead.  Default: `no-reply@wixsitemail.com`
        - name: replyTo | type: Recipient | description: Recipient that receives replies to this email. When a recipient replies, the reply is directed to this address instead of the sender address.  Default: When `senderEmailAddress` is provided and the email is sent from the Wix shared sender address, replies are automatically directed to `senderEmailAddress`.
           - ONE-OF:
              - name: contactId | type: string | description: GUID of the contact to send the email to. The contact's email address is retrieved from the Contacts API.
              - name: userId | type: string | description: GUID of the Wix user to send the email to. The user must be a site collaborator.  The user's email address is retrieved from the Users API.
              - name: emailAddress | type: string | description: Email address to send the email to. A contact is created with this address if one doesn't already exist.
           - name: name | type: string | description: Display name of the recipient.
           - name: failureReason | type: FailureReason | description: Reason why the email couldn't be delivered to this recipient. `NONE` means the email was successfully sent.  Returned once the transmission reaches `PROCESSED` status.
               - enum:
               -     NONE: Email was successfully sent to this recipient.
               -     RECIPIENT_NOT_FOUND: Contact or user wasn't found by the provided ID.
               -     EMAIL_ADDRESS_MISSING: Contact or user doesn't have an email address.
               -     EMAIL_ADDRESS_INVALID: Email address doesn't exist or is invalid.
               -     EMAIL_ADDRESS_BOUNCED: Email address has previously bounced and can't be sent to.
               -     MARKETING_CONSENT_NOT_GIVEN: Recipient hasn't given consent to receive marketing emails.
               -     NOT_SITE_COLLABORATOR: User isn't a collaborator on this site. Only site collaborators can be specified as recipients by user ID.
        - name: toRecipients | type: array<Recipient> | description: List of recipients the email is sent to.
        - name: type | type: Type | description: Email type.
           - enum:
           -     TRANSACTIONAL: Email triggered by a specific action, such as an order confirmation or booking reminder. No unsubscribe link is added.
           -     MARKETING: Email sent to multiple recipients as part of a campaign, such as a newsletter or promotion. An unsubscribe link is automatically added.
        - name: status | type: Status | description: Current status of the email transmission.
           - enum:
           -     ACCEPTED: Email transmission was accepted and is queued for processing.
           -     IN_PROGRESS: Email transmission is being processed. The content is being checked, recipients are being resolved, and emails are being sent.
           -     PROCESSED: Email transmission has been fully processed. Per-recipient delivery information is available in `toRecipients`.
           -     REJECTED: Email transmission failed an abuse check. No emails were sent. See `rejectedOptions` for details.

```

---

## JavaScript SDK

### Schema

```
Webhook: onEmailTransmissionUpdated
Description: Triggered when an email transmission is updated.
Payload: EmailTransmissionUpdatedEnvelope
  - name: entity | type: EmailTransmission | description: none
     - ONE-OF:
        - name: marketingOptions | type: MarketingOptions | description: Options for marketing emails.  Used only when `type` is `MARKETING`.
           - name: unsubscribeUrlPlaceholder | type: string | description: Placeholder in `emailHtmlContent` that gets replaced with a recipient-specific unsubscribe URL before the email is sent. Case-sensitive. For example, `{{unsubscribe_url}}` or `[UNSUBSCRIBE_URL]`. The placeholder must be unique within the HTML content.  If not set, an unsubscribe link in the site's default language is appended to the bottom of the email.
     - name: _id | type: string | description: Email transmission GUID.
     - name: _createdDate | type: Date | description: Date and time the email transmission was created.
     - name: _updatedDate | type: Date | description: Date and time the email transmission was last updated.
     - name: revision | type: string | description: Revision number, which increments by 1 each time the email transmission is updated.
     - name: emailSubject | type: string | description: Subject line of the email.  Default: None (email is sent without a subject line).
     - name: emailHtmlContent | type: string | description: Full HTML content of the email.  Not returned in `queryEmailTransmissions`. Use `getEmailTransmission` to retrieve the HTML content of a specific transmission.  Stored for 30 days after the transmission is created. After that, this field returns `"<expired>"`.
     - name: metadata | type: object | description: Custom key-value pairs attached to the transmission to identify the context in which the email was sent. These values are passed to the email service provider and included in domain event payloads. Keys and values support alphanumeric characters only (letters and numbers, no spaces or special characters).  Default: `{}`
     - name: senderName | type: string | description: Display name shown as the sender.  Default: None (no display name is set).
     - name: senderEmailAddress | type: string | description: Sender email address. Must be verified using the Sender Emails API before use.  If the provided address can't be used as a FROM address (for example, addresses from free email providers such as gmail.com), the email is sent from `no-reply@wixsitemail.com` and the provided address is automatically used as the reply-to address instead.  Default: `no-reply@wixsitemail.com`
     - name: replyTo | type: Recipient | description: Recipient that receives replies to this email. When a recipient replies, the reply is directed to this address instead of the sender address.  Default: When `senderEmailAddress` is provided and the email is sent from the Wix shared sender address, replies are automatically directed to `senderEmailAddress`.
        - ONE-OF:
           - name: contactId | type: string | description: GUID of the contact to send the email to. The contact's email address is retrieved from the Contacts API.
           - name: userId | type: string | description: GUID of the Wix user to send the email to. The user must be a site collaborator.  The user's email address is retrieved from the Users API.
           - name: emailAddress | type: string | description: Email address to send the email to. A contact is created with this address if one doesn't already exist.
        - name: name | type: string | description: Display name of the recipient.
        - name: failureReason | type: FailureReason | description: Reason why the email couldn't be delivered to this recipient. `NONE` means the email was successfully sent.  Returned once the transmission reaches `PROCESSED` status.
             - enum:
             -     NONE: Email was successfully sent to this recipient.
             -     RECIPIENT_NOT_FOUND: Contact or user wasn't found by the provided ID.
             -     EMAIL_ADDRESS_MISSING: Contact or user doesn't have an email address.
             -     EMAIL_ADDRESS_INVALID: Email address doesn't exist or is invalid.
             -     EMAIL_ADDRESS_BOUNCED: Email address has previously bounced and can't be sent to.
             -     MARKETING_CONSENT_NOT_GIVEN: Recipient hasn't given consent to receive marketing emails.
             -     NOT_SITE_COLLABORATOR: User isn't a collaborator on this site. Only site collaborators can be specified as recipients by user ID.
     - name: toRecipients | type: array<Recipient> | description: List of recipients the email is sent to.
     - name: type | type: Type | description: Email type.
         - enum:
         -     TRANSACTIONAL: Email triggered by a specific action, such as an order confirmation or booking reminder. No unsubscribe link is added.
         -     MARKETING: Email sent to multiple recipients as part of a campaign, such as a newsletter or promotion. An unsubscribe link is automatically added.
     - name: status | type: Status | description: Current status of the email transmission.
         - enum:
         -     ACCEPTED: Email transmission was accepted and is queued for processing.
         -     IN_PROGRESS: Email transmission is being processed. The content is being checked, recipients are being resolved, and emails are being sent.
         -     PROCESSED: Email transmission has been fully processed. Per-recipient delivery information is available in `toRecipients`.
         -     REJECTED: Email transmission failed an abuse check. No emails were sent. See `rejectedOptions` for details.
  - name: metadata | type: EventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them.
     - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     - name: entityId | type: string | description: GUID of the entity associated with the event.
     - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
     - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
     - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.

```

### Examples


```javascript
import { emailTransmissions } from '@wix/email-transmissions';

emailTransmissions.onEmailTransmissionUpdated((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { emailTransmissions } from '@wix/email-transmissions';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      emailTransmissions,
    },
});

wixClient.emailTransmissions.onEmailTransmissionUpdated((event) => {
    // handle your event here
});
```

---