> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/adobe-commerce-magento/additional-features/email-marketing-opt-in.md).

# Email Marketing Opt-in

The Email Marketing Opt-in feature lets retailers capture shopper marketing consent during ESW checkout and sync it to Adobe Commerce. The extension supports [native newsletter subscription](https://experienceleague.adobe.com/docs/commerce-admin/config/customers/newsletter.html?lang=en) out of the box. You can also extend this behavior with a third-party newsletter integration.

### Email Marketing Opt-in configuration

The ESW marketing opt-in feature is usually enabled on ESW Checkout by default. If it is not enabled for your store, contact your ESW point of contact.

To enable sync in Adobe Commerce (Magento), set **Email Marketing Sync Opt-In** to **Yes** in the ESW Checkout configuration.

{% hint style="info" %}
The checkout opt-in control must be enabled in ESW Checkout before Adobe Commerce can receive and store the shopper preference.
{% endhint %}

### How the opt-in sync works

When a shopper selects the marketing opt-in checkbox during ESW checkout, the extension updates the newsletter subscription status in Adobe Commerce.

The sync behavior depends on whether the shopper is logged in or checks out as a guest.

### Logged-in shopper flow

For a logged-in shopper, the subscription preference is linked to the existing customer account.

1. The shopper signs in and adds items to the cart.
2. The shopper proceeds to ESW checkout.
3. The shopper selects the marketing opt-in checkbox and places the order.
4. Adobe Commerce updates the shopper newsletter preference.
5. The updated status is visible under **Newsletter Subscription** in the customer account area.
6. The same subscription status is reflected in the shopper profile in Adobe Commerce Admin.

### Guest shopper flow

For a guest shopper, the subscription preference is linked to the email address entered during checkout.

1. The shopper adds items to the cart.
2. The shopper proceeds to ESW checkout.
3. The shopper selects the marketing opt-in checkbox and places the order.
4. Adobe Commerce updates the newsletter subscription status for the checkout email address.
5. The updated status is visible in Adobe Commerce Admin.

### Expected result

After checkout completes, Adobe Commerce stores the shopper marketing preference and keeps the newsletter subscription status aligned with the ESW checkout selection.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.esw.com/adobe-commerce-magento/additional-features/email-marketing-opt-in.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
