Sending transactional mails

Note:  This topic is for administrators and developers with administration access rights in Episerver Campaign.

The Spryker integration lets you send out transactional mails using Episerver Campaign's efficient server infrastructure. The sending is done via HTTP-API directly from Spryker.

You can use transactional mails to respond to customers' actions in your shop, such as order confirmations, or to send system emails, which include:

  • Login confirmation
  • Password changes and confirmation
  • Order confirmations

Configuring transactional mails in Episerver Campaign

Sending of transactional mails requires a template in Episerver Campaign, which uses field functions to insert sent variables into relevant locations. This creates the finished transactional mail with layout, and sends it to the recipient. The sending and receiving of the content of the variables takes place using the transaction recipient list as a buffer.

  1. The Spryker integration sends the variables.
  2. The variables are written into the transaction recipient list: each variable into the relevant recipient list field.
  3. Using field functions, Episerver Campaign copies the template with the individual variables from the transaction recipient list and places it into the desired location in the transactional mail.

Image: Sending and receiving content of variables

Recipient list fields in Episerver Campaign's transaction recipient list

By default, the transaction recipient list contains the following fields.

Field name Data type Description
email String Email (required)
salutation String Title
firstname String First name
lastname String Last name
spryker_id String Spryker ID
customer_shop_locale String Language setting in customer shop
customer_shop_url String Customer shop url
customer_login_url String Customer login url
customer_reset_link String Customer reset link
language String Language
order_number String Order number
order_comment String Order comment
order_orderdate String Order date
order_subtotal String Order Subtotal
order_discount String Discount on order
order_tax String Tax on order
order_grand_total String Total sum of order
order_total_delivery_costs String Delivery costs
order_total_payment_costs String Payment costs
subscriber_key String Individual key of user in Spryker Commerce

Creating a template in Episerver Campaign

Create a template and add the desired transactional mail texts (the unchangeable, static texts that are to be sent to recipients). Insert field functions in places where you want to show content of the Spryker variables.

About field functions

Field functions are placeholders that refer to a specific recipient list field in your transaction recipient list. The variables and content of the variables sent from Spryker are written into the relevant recipient list fields in your transaction recipient list. Your field functions load relevant content from the referenced recipient list field in the next step.

Example

Set up a transactional mail text that welcomes each customer using the last name and the order date. For this you would need the variables salutation, lastname and order_orderdate.

The content of the variables is first written to a relevant recipient list field of the transaction recipient list (from Spryker via the HTTP API). To access these recipient list fields, insert the individual field functions into the Episerver Campaign template and place the name of the recipient list field in curly brackets. To import the variable contents, the static text and field functions in the Campaign template could look like this:

Hello, {salutation} {lastname}!
Thank you for your online order from {oder_orderdate}.

The example will appear in the sent transactional mail as follows:

Hello, Mr. Miller! Thank you for your online order from August 3.

To create the template:

  1. Log in to Episerver Campaign.
  2. Go to start menuMain screen in Episerver Campaign, where the available options are grouped together. and select Campaigns > Transactional mails.

    Image: Transactional Mails in start menu

  3. Click Create.

    Image: Create transactional email

  4. Drag the Recipients node from the left action area to the workspace area on the right.
  5. In the Recipient lists drop-down list, select your transaction recipient list.

    Image: Selecting transaction recipient list

    Note:  Customer support sets up a separate transaction recipient list. Be sure you use this transaction recipient list, instead of a regular recipient list.

  6. From the left action pane, drag a message node with the media type Email into the workspace.
  7. In the Name box, assign a concise name to your transactional mail (for example, order confirmation).

    Image: Edit confirmation name

  8. In the context menu for the messages node, click Edit content.
  9. In the Template drop-down list, select the desired template and confirm your selection by clicking Next.
  10. Configure the template for the transactional mail according to your requirements. Enter a subject and insert the static texts that you want recipients to receive, into the content paragraphs. Insert the relevant field function for the recipient list field of the transaction recipient list into places where variables from Spryker should appear (see the previous example in this topic).
  11. Click Close.
  12. Connect the Recipient node with the message node.

    Image: Connect nodes

  13. Click Save and close.
  14. To activate your transactional mail and start the sending process, select the mailing in the Transactional mails overview and click Start.

Configuring transactional mails in Spryker

To set up transactional mails in Spryker, follow the steps on the Spryker documentation website.