Do you want to remind your customers that they have an abandoned cart?

Quickly set up automatic abandoned cart management emails

 

Objective

This tutorial describes how to send automated emails to customers who have an abandoned cart on your Magento e-commerce website, and help them to complete their purchase.

 

Flow

A suitably configured Magento installation records an abandoned cart event, and inserts it in the individual customer’s event profile section of Contacthub, through the Contacthub Connect for Magento plug-in.

Contacthub then applies a specifically defined automation and instructs Contactsend to automatically send a previously prepared email.

 

Procedure

  1. Configure Magento
  2. Create an email template in Contactsend
  3. Create an automated email delivery in Contacthub

1. Configure Magento: Instigating an abandoned cart email

Do the following:

  1. On the Admin Panel of your Magento installation, click System > Configuration, then in the Configuration panel, click CONTACTLAB > Contacthub.
  2. Click Event track to enable Abandoned Cart management and define the available options.

 

For example, you can:

  • Enable abandoned cart events to also be sent for non-registered customers.
  • Define how many minutes the system should wait before sending an abandoned cart event and, as a result, the corresponding email.

It is the Minimum number of minutes field that defines how long the system should wait, after the start of an uncompleted purchase procedure, before regarding a cart as abandoned.

The maximum number of minutes value is used if, for example, abandoned cart management is suspended and then reactivated later. It is generally ineffective to send an email after an excessive amount of time. The Contacthub Connect for Magento plug-in adds abandoned cart events to the individual customer profile within Contacthub.

 

2. Create the email template in Contactsend

The next step is to create the template in Contactsend, which will be used to automatically send an email to customers with an abandoned cart, according to the rules that you have defined under Configure Magento.

The template HTML must contain the syntax that is needed to include information about the customer and the products in their cart, which is provided by Contacthub. For example, the number of products in the cart and their details.

Contactlab provides a range of simple standard templates, which have been specially designed for abandoned cart management. However, you can also ask our Agency to provide a quote for creating a custom template, according to your specific needs.

To create the email template, you need to configure a SendImmediate delivery in Contactsend. Do the following:

  1. Click Create > Send email.
    The Email campaign wizard displays.
  2. Click Create a new immediate message delivery (SendImmediate delivery).
  3. Complete the Delivery parameters page, as appropriate.
    See the Contactsend Guide for full details.

 

  1. Under Message content, enter the Sender details and Email subject.
  2. Under HTML version, load the abandoned cart template.

The template can be configured according to your needs, for example, by:

  • Including all of the items left in the cart, or just a few.
  • Respecting your graphic guidelines.
  • Conforming with responsive design standards.
    Automatically adapting to  different screen sizes.

For example:

 

The appendix of this tutorial includes template-related information, with examples of the variables that collect information about the products in the cart, such as the name, price, image, and similar.

IMPORTANT:
Any variable name that is used in the template must be the same as the one used when configuring the Contacthub automation. See Section 3 of this tutorial for more details.

  1. Once you have added the template’s HTML, complete all the wizard steps and, when you are finished, click End.
    The SendImmediate ID is displayed.
  2. Make a note of the ID.
    You need to enter this in the Campaign ID field, when creating the email delivery in Contacthub.  See Section 3 for more details.

 

3. Create an automated email delivery in Contacthub

Do the following:

  1. Log in to Contacthub and click Automations.
  2. Click Create a new automation and enter a suitable name.
    For example, ‘Abandoned Cart’.

 

  1. Under Trigger > Events, select Abandoned cart event, and under Context, select E-commerce event.
  2. Under Action, select Send email and enter the required information about the automatic email delivery, as follows:
    1. The apiKey and userKey are the configuration keys for the API.
    2. Under Campaign ID, enter the SendImmediate ID you noted from Contactsend. See Section 2 for more details.
    3. Under Recipient type, select Customer property.
    4. Under Recipient address, select Email [Contact details].

 

  1. Complete the list of variable fields that are to be inserted in the SendImmediate delivery that you created in Contactsend, in Section 2, as follows:
    1. Add a separate In field line for each variable and enter the relevant details.
      For example, in the above screenshot, the CUSTOMERNAME variable name has been used to identify the field for the customer’s First name property. PRODUCTNAME, PRODUCTPRICE, PRODUCTSKU and so on have been used as the names for other properties, but you should use the names you require.
      IMPORTANT:
      Variable names must be the same as the ones used in the SendImmediate template that you created in Contactsend. See Section 2 and the appendix for more details.
  2. When you are finished, click Save.
    The automation is saved and activated.

Once you have completed these steps, every abandoned cart event that the Magento plug-in sends to Contacthub, will result in an automatic email being sent according to your configuration.

 

 

 

Appendix

As previously mentioned, the Contactlab Agency can provide custom abandoned cart templates, as required. The following examples, however, illustrate how to insert customer and product information variables in an HTML page.

The first example shows how to insert the details for all the products in a cart, such as SKU, image, name and price, in a table :

 

<html>
<body>
<p>Hello ${CUSTOMERNAME}$</p>
<table>
<tr>
<th>SKU</th>
<th>IMAGE</th>
<th>NAME</th>
<th>PRICE</th>
</tr>
<%
name_products = get_user_data('PRODUCTNAME').to_s.split('|')
price_products = get_user_data('PRODUCTPRICE').to_s.split('|')
sku_products = get_user_data('PRODUCTSKU').to_s.split('|')
img_products = get_user_data('PRODUCTIMG').to_s.split('|')
default_value = "N/A"
default_image = "http://www.domain.xx/image.gif"

name_products.each_with_index do |name_product, idx|
%>
<tr>
<td><%= sku_products[idx].nil? ? default_value : sku_products[idx] %></td>
<td><img src="<%= img_products[idx].nil? ? default_image : img_products[idx] %>"></td>
<td><%= name_product.nil? ? default_value : name_product %></td>
<td><%= price_products[idx].nil? ? default_value : price_products[idx] %></td>
</tr>
<% end %>
</table>
</body>
</html>

The second example shows how to display only the first product in the cart, along with an automatic default text, which should be used if a value cannot be found:

 

<html>
<body>
<p>Hello ${CUSTOMERNAME}$</p>
<table>
 <tr>
 <th>SKU</th>
 <th>IMAGE</th>
 <th>NAME</th>
 <th>PRICE</th>
 </tr>
 <%
 default_value = "N/A"
 default_image = "http://www.domain.xx/image.gif"
 %>
 <tr>
 <td><%= get_user_data('PRODUCTSKU').to_s.split('|')[0].nil? ? default_value : get_user_data('PRODUCTSKU').to_s.split('|')[0] %></td>
 <td><img src="<%= get_user_data('PRODUCTIMG').to_s.split('|')[0].nil? ? default_image : get_user_data('PRODUCTIMG').to_s.split('|')[0] %>"></td>
 <td><%= get_user_data('PRODUCTNAME').to_s.split('|')[0].nil? ? default_value : get_user_data('PRODUCTNAME').to_s.split('|')[0] %></td>
 <td><%= get_user_data('PRODUCTPRICE').to_s.split('|')[0].nil? ? default_value : get_user_data('PRODUCTPRICE').to_s.split('|')[0] %></td>
 </tr>
</table>
</body>
</html>