In order for email subscriptions to work, a few updates need to be made on the storefront cartridge and inside the Business Manager. Your customers can subscribe on their account profile page, during the checkout process and in the global footer.

Note: Your opt-in strategy is configured as part of the data synchronization workflow.

Contents

Custom code inside core templates

Add the following lines of code at the bottom of the footer_UI.isml template:

<script type="text/javascript"><isinclude template="resources/emarsysresources"/></script>
<script src="${URLUtils.staticURL('/js/emarsys.js')}" type="text/javascript"></script>

demandware-custom-code-core-template-1

Then add the .css file into the htmlhead.isml template:

<link rel="stylesheet" href="${URLUtils.staticURL('/css/stylesheet.css')}" />

demandware-custom-code-core-template-2

Account profile page subscription

Visitors to the webshop can subscribe and unsubscribe via their account profile page:

demandware-account-subscription

To enable subscription from the account profile page, an update to the account pipeline needs to be made. There is also a small change required in the account-nav-registered content asset. Proceed as follows:

In the Business Manager, go to Merchant Tools > Content > Content Assets and search for the account-nav-registered content asset.

Lock the content asset in order to be able to edit it, then go to the body attribute and add the following line to the list in the My Account section:

<li><a title="Email Settings" href="$httpsUrl(EmarsysNewsletter-EmailSettings)$">Email Settings</a></li>

demandware-custom-code-content-asset

In your storefront core cartridge, find the Account-CreateAccount pipeline. After the LoginCustomer pipelet and before the end node, add a call node to call the EmarsysNewsletter-AccountSubscription pipeline.

demandware-custom-code-pipeline-1

Then find the Account-EditProfile pipeline. Before the Account-Show jump node, add a call node to call the EmarsysNewsletter-AccountSubscription pipeline.

demandware-custom-code-pipeline-2

Checkout subscription

Visitors to the webshop can subscribe on the checkout page:

demandware-checkout-subscription

They can do this either as a registered visitor or as a guest. After adding their product to the cart, in the billing stage of the checkout process they should enter their email address and select both the Please add me to the Demandware email list. Demandware does not share or sell personal info. and the I have read the Privacy Policy and I agree. checkboxes. Once they have completed their purchase, they are subscribed and the personal data they have entered is sent to Emarsys.

To enable subscriptions from the checkout page, an update to the COBilling-Start pipeline from the core cartridge also needs to be made. Inside this pipeline, after the COBilling-SaveAddress call node, add a call node to call the EmarsysNewsletter-CheckoutSubscription pipeline.

demandware-custom-code-pipeline-3

Global footer subscription

Visitors to the webshop can subscribe by entering their email address in the global footer. This can be done by typing an email address directly into the subscription box.

demandware-footer-subscription

If a customer clicks the Subscribe button without entering any email address, they will be directed to a sign-up form where they can enter their information. Clicking Sign me up for email will subscribe them and send the data they entered to Emarsys.

demandware-signup-form

To enable subscriptions from the global footer to work, an update is required in the body of the footer-social-email content asset.

In the Business Manager, go to Merchant Tools > Content > Content Assets and search for the footer-social-email content asset.

Lock the content asset in order to be able to edit it, then go to the body attribute and update the ID of the form to emarsys-newsletter-subscription.

demandware-custom-code-footer

Demandware landing pages

Depending on which opt-in strategy has been configured for the subscriptions methods and depending on the unsubscription strategy (direct/indirect), your customers can be redirected to several landing pages, as follows:

  • Thank you page – Single Opt-in strategy

demandware-landing-page-1

  • Thank you page – Double Opt-in strategy

demandware-landing-page-2

  • Data submitted page – Double Opt-in strategy

demandware-landing-page-3

  • Action page – Indirect unsubscribe

demandware-landing-page-4

  • Thank you page – Unsubscribe

demandware-landing-page-5