In Demandware you can define certain transactional emails, for example an Order confirmation email or a shipping confirmation email. These emails can be triggered in the Emarsys application by associating the event in question with an Emarsys external event. You can then associate that external even with an Automation Center program to trigger the actual email.

Contents

Transactional Emails Setup

Before you can configure your transactional emails for order and shipping confirmation you first need to define which Demandware elements (data fields) will be used for them.

In the Business Manager, go to Merchant Tools > Site Preferences > Custom Site Preferences > Emarsys Transactional Emails Setup.

Open the Order Confirmation Extension screen and define the Demandware elements that will be used for the order confirmation emails.

demandware-order-confirmation-elements

Then do the same for the Shipping Information Elements.

demandware-shipping-information-elements

You are now ready to configure your transactional emails.

Subscription link parameters for emails

All confirmation and unsubscribe links in your Emarsys emails should contain the following parameters, to ensure that they are pointing to the Demandware instance (since Demandware logic is taking care of unsubscribing or subscribing the contact).

  • Double opt-in

The double opt-in confirmation link should contain:

/on/demandware.store/Sites-SiteGenesis-Site/en_US/EmarsysNewsletter-AccountoutDoubleOptInThankYou?uid=$uid$

  • Unsubscribe link

The unsubscribe link should contain:

/on/demandware.store/Sites-SiteGenesis-Site/default/EmarsysNewsletter-Unsubscribe?uid=$uid$&cid=$cid$&lid=$llid$&direct=n

Unsubscribe link for List-Unsubscribe header

If you are using the List-Unsubscribe feature, then this link should contain:

/on/demandware.store/Sites-SiteGenesis-Site/default/EmarsysNewsletter-Unsubscribe?uid=$uid$&cid=$cid$&lid=$llid$&direct=y

Order Confirmation integration

Before you can set up your order confirmation emails you need to integration them into your pipeline. Proceed as follows:

In the storefront core cartridge find the COPlaceOrder-Start pipeline. Before the Mail-SecureSend call node, add a call to call EmarsysEmails-OrderConfirmation pipeline.

demandware-custom-code-pipeline-3

Personalizing content

As well as the personalization options available in the Emarsys CMS, you can also use placeholders to add transactional content from Demandware about the order and the customer.

This should be added to the email content as %%placeholder_name%%.

Click here for a full list of placeholders.

Order Confirmation configuration

As soon as a customer completes a transaction the order data should be transmitted to Emarsys and a confirmation email sent to the customer. Demandware will check in the Emarsys account if the contact record already exists, and will then update it or create a new record. At the same time, the external event will trigger a confirmation email containing the transactional data as defined by the Demandware elements selected above.

To configure your order confirmation email, proceed as follows:

In the Business Manager, go to Merchant Tools > Emarsys Integration > Order Confirmation configuration and click Add fields.

Here you can see the fields that you previously selected. Defined a placeholder for each field and then select the Emarsys external event that will trigger the email. To remove a field from this transactional email, activate the Remove checkbox.

demandware-order-confirmation-email

Click Apply to save your changes. As long as the selected external event has been linked to an active Automation Center program, an order confirmation email will now be triggered.

Shipping Confirmation configuration

As soon as a product has been shipped to a customer this information should also be transmitted to Emarsys and an email sent to that customer, ideally containing a shipment tracking link. As for the Order Confirmation, Demandware will first check in Emarsys if the contact record exists and then update or create it. At the same time, the external event will trigger an email containing the shipping information as defined by the Demandware elements selected above.

To set up the shipping confirmation emails, in the Business Manager go to Administration > Operations > Workflow Schedules. Select the Emarsys-SendShippingEmails workflow and click Run (queue and start).

demandware-configuration-send-shipping-workflow

To configure your order confirmation email, now go to Merchant Tools > Emarsys Integration > Shipping Confirmation configuration and click Add fields.

Here you can see the fields that you previously selected. Defined a placeholder for each field and then select the Emarsys external event that will trigger the email. To remove a field from this transactional email, activate the Remove checkbox.

demandware-shipping-confirmation-email

Click Apply to save your changes. As long as the selected external event has been linked to an active Automation Center program, a shipping confirmation email will now be triggered.

Note: Shipping confirmation emails will only be sent for orders that are placed while the Emarsys integration was enabled. No legacy orders will be considered for shipping confirmation emails.