---
title: Walkthrough - Sending an automated reminder of an abandoned shopping cart
related:
  - https://docs.kentico.com/13/e-commerce-features/developing-on-line-stores/implementing-a-checkout-process.md
  - https://docs.kentico.com/13/e-commerce-features/customizing-on-line-stores/shopping-cart-related-customizing/customizing-marking-shopping-carts-as-abandoned.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** **Enterprise license required**
>
> Features described on this page require the **Kentico Xperience Enterprise** license.

This page provides a step-by-step example that you can follow to create a new [marketing automation](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md) process from start to end. The walkthrough's goal is to send an automated email when a [customer](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers.md) leaves the website with products remaining in the [shopping cart](https://docs.kentico.com/13/e-commerce-features/developing-on-line-stores/implementing-a-checkout-process/integrating-the-shopping-cart.md). This scenario presumes a situation where a customer considers purchasing some products, but then changes their mind, and the store administrators want to remind the customer of the products.

In such a scenario, customers can be:

- Registered – the customer has a [user](https://docs.kentico.com/13/managing-users/user-management.md) and a [contact](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management.md) assigned.
- Anonymous with a known email address – the customer has a contact with an email assigned.
- Anonymous without a known email address.

The abandoned cart reminder works with the first two groups – registered customers and anonymous customers whose email address the system knows. You cannot reach customers whose email the system does not know.

The walkthrough consists of the following steps:

1. [Setting after how many hours shopping carts are considered as abandoned.](#setting-after-how-many-hours-shopping-carts-are-considered-as-abandoned)
2. [Creating a scheduled task for marking shopping carts as abandoned.](#creating-a-scheduled-task-for-marking-shopping-carts-as-abandoned)
3. [Creating a marketing automation process for sending abandoned shopping cart reminders.](#creating-a-marketing-automation-process-for-sending-abandoned-shopping-cart-reminders)

## Setting after how many hours shopping carts are considered as abandoned

As with most of the e-commerce settings, you can adjust the time after the shopping carts are considered as abandoned for [the current site or globally for all your sites running on the Xperience instance](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/choosing-site-or-global-e-commerce-configuration.md). If you run multiple sites on your instance and all sites should use the same number of hours, use global settings. Otherwise, we recommend that you choose site settings.

> **Tip:** If you are not sure about these settings, see [Choosing site or global e-commerce configuration](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/choosing-site-or-global-e-commerce-configuration.md) to learn more information about types of e-commerce settings.

1. Open the **Store configuration** application (if you want to specify the setting for the current site) or the **Multistore configuration** application (if you want to specify the setting globally).
2. In the **Shopping cart** category of the **Store settings -> General** tab, enter the following properties to the **Mark shopping cart as abandoned after (hours)** field:

   - Clear the _Inherit from global settings_ option (only if you work in the **Store configuration** application).
   - Type the desired number of hours after which shopping carts should be considered as abandoned to the text box, for example _15_.
3. Click **Save**.

The system updates the settings and scheduled tasks working with this setting use the specified number of hours.

## Creating a scheduled task for marking shopping carts as abandoned

To set up sending of automated reminders about abandoned shopping carts, you need to create a scheduled task that selects and marks abandoned shopping carts.

1. Open the **Scheduled tasks** application.
2. Switch to the desired site.

   ![Switching to a site](https://docs.kentico.com/docsassets/13/walkthrough-sending-an-automated-reminder-of-an-abandoned-shopping-cart/switching_to_site.png "Switching to a site")

   > **Info:** You cannot create the task as global. If you do so, the task will not have any effect.
3. Click **New task**.
4. Enter the following properties:

   - **Task display name**: Mark shopping cart as abandoned
   - **Task provider**:
     - _Assembly name_: CMS.Ecommerce
     - _Class_: CMS.Ecommerce.MarkCartAbandoned
   - **Task enabled**: Yes (selected)
5. Enter the [other properties](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks/reference-scheduled-task-properties.md) according to your needs.
6. Click **Save**.

The system now marks abandoned shopping carts according to the configured time interval.

## Creating a marketing automation process for sending abandoned shopping cart reminders

To send the reminders, create a marketing automation process.

### Set properties of the process

First, you need to create a process and specify its properties.

1. Open the **Marketing automation** application.
2. Click **New process**.
3. Select the **Abandoned cart reminder** template as a starting point.
4. Switch to the **General** tab and set the following value:

   - **Process recurrence**: If the same process is not already running
5. Click **Save**.

The process is now created.

### Design the process

Second, configure the steps within the process. The template already provides the basic steps, but you can adjust them as required.

1. Switch to the **Process** tab (and **Design** mode).

   > **Info:** If you select the **Start triggers** step, you can notice the process has a trigger. The trigger automatically starts the process for contacts who perform the _Shopping cart abandoned_ activity.
2. Select the **Send email** step between the _Start_ and _Finished_ steps.
3. Enter the following properties:

   - **From**: _enter your email address, e.g. admin@localhost.local_
   - **To**: {% Contact.ContactEmail %}
   - **Based on**: HTML formatted text
     - Alternatively, if you have an [email template](https://docs.kentico.com/13/configuring-xperience/managing-email-templates.md) prepared, you can select _Email template_ and then the specific template.
   - **Subject**: A Coffee Reminder!
   - **Body**: _type the body of the email. Use macros to generate content and links for the specific contact, for example:_

     ```csharp title="Macro example"

     {%
     // Gets the site object on which the "Shopping cart abandoned" activity occurred
     site = System.GetObject("cms.site", ActivitySiteID);

     // Gets the URL of the shopping cart page with the restored content of the abandoned cart
     cartLink = ShoppingCartAbsoluteUrl(site.SiteName, "en-us", ActivityValue);
     return;
     %}

     <a href="{% cartLink %}">CONTINUE SHOPPING</a>

     {% 
     // Gets a list of the items (products) in the abandoned shopping cart and displays them
     foreach(item in ShoppingCartProducts(ActivityValue)) { 
     %}
         <p>{% FormatPriceForCart(item.UnitPrice, item.ShoppingCartID)%}</p>
         <p>{% item.SKU.SKUName %}</p>
     {% } |(encode)false %}

     ```

     > **Info:** The **ActivityValue** in the macros stores the abandoned shopping cart's identifier (GUID). The site's implementation needs to ensure that the displayed cart page contains the products from the abandoned cart. The **ActivitySiteID** stores the identifier of the site where the activity occurred.
     >
     > For more information, see:
     >
     > - [Reference - Macro methods](https://docs.kentico.com/13/macro-expressions/reference-macro-methods.md)
     > - [Writing transformations for macros](https://docs.kentico.com/13/macro-expressions/writing-transformations-for-macros.md)
4. Click **Apply**.

   ![Configuring the Send email step](https://docs.kentico.com/docsassets/13/walkthrough-sending-an-automated-reminder-of-an-abandoned-shopping-cart/Process_Send_Email_Step.png "Configuring the Send email step")
5. Click **Enable** above the designer toolbar to activate the process once everything is ready.

The marketing automation process is now complete. The system automatically sends an email after  the specified number of days based on the specified HTML text (or an email template) to every customer who puts products in the shopping cart and then leaves.

> **Tip:** **Designing more complicated processes**
>
> If you want to design a more complex process, see [another walkthrough](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation/walkthrough-creating-a-marketing-automation-process.md) describing in more detail all steps of creating a marketing automation process.
