CartThrob 9 documentation for ExpressionEngine commerce teams Visit CartThrob.com
CartThrob.com

CartThrob Expired Cart Notifications Version 2.1.0

Overview

CartThrob Expired Cart Notifications sends follow-up emails for carts that were started but not completed.

Core behavior:

  • tracks cart email and expiration state while customers add to cart
  • marks carts as completed when checkout is authorized
  • sends staged notifications based on configured timing rules
  • supports additional recurring follow-ups after initial staged notifications
  • supports debug mode so repeated test sends do not advance expiration counters

Requirements

  • CartThrob installed and active (installation is blocked when CartThrob is missing)
  • ExpressionEngine support milestones from changelog:
  • 2.0.0: ExpressionEngine 5 support
  • 2.1.0: ExpressionEngine 6 support

Installation

  1. Upload cartthrob_expired_cart_notifications to /system/user/addons/.
  2. Install CartThrob Expired Cart Notifications in ExpressionEngine Add-on Manager.
  3. Create one or more email templates that will be used for cart notifications.
  4. Open add-on settings and configure notification events plus additional notification settings.
  5. Configure a scheduled ping for the generated CRON URL.

Upgrading

From versions before 2.0

  1. Uninstall older add-on version.
  2. Install again using the current installation steps.

From 2.0+

  1. Upload new files over existing add-on files.
  2. Run add-on update in ExpressionEngine.
  3. Recheck settings and CRON URL in add-on settings.

Start Here (10-Minute Setup)

  1. Create one notification template in EE templates (example: emails/abandoned_cart_1hr).
  2. In Expired Cart Notifications settings, add one Notification events row:

- Minutes to notification: 60 - Notification template: your template path - Notification email subject: short subject line 3. Set How many times should this customer be contacted? to 1. 4. Set How many days between customer notifications? to 7. 5. Copy the generated CRON URL and schedule it to run regularly. 6. Create a test cart with an email address, wait past threshold, then trigger CRON URL.

Common Tasks With Examples

1. Create Tiered Initial Notifications

Goal: send different messages at multiple minute thresholds.

Example rows:

  • 30 minutes: reminder
  • 180 minutes: stronger follow-up
  • 1440 minutes: one-day reminder

Each row selects its own template and subject.

2. Configure Ongoing Follow-Ups

Goal: continue outreach after initial tiered notifications.

  • How many times should this customer be contacted?: max additional follow-up cycles
  • How many days between customer notifications?: interval between additional cycles
  • Additional notification template: generic long-term reminder template
  • Additional notification subject: subject for that generic reminder

3. Test Without Burning Through Carts

Goal: repeatedly test same abandoned cart payload.

  • enable Notification debug = yes
  • run CRON URL repeatedly
  • verify emails send while cart expired counters are not advanced by debug mode
  • Need minute-based first-pass notifications: use Notification events grid.
  • Need long-term recurring reminders: use Additional regular notifications settings.
  • Need the endpoint to schedule: copy CRON Notification URL from settings.
  • Need safe repeated testing: use Notification debug.

Control Panel Reference

Route: addons/settings/cartthrob_expired_cart_notifications

Settings Form Fields

Notification events (grid)

Columns:

  1. Minutes to notification (notify_minutes)
  2. Notification template (notification_template)
  3. Notification email subject (notification_subject)

Behavior:

  • grid rows are stored in serialized setting notification_events
  • rows are sorted by notify_minutes before processing

Additional regular notifications

  1. How many days between customer notifications? (notify_every)

- intended day interval for additional recurring notifications

  1. How many times should this customer be contacted? (notification_attempts)

- number of additional recurring notification passes

  1. Additional notification template (additional_notification_template)

- fallback template used for additional recurring notifications

  1. Additional notification subject (additional_notification_subject)

- fallback subject used for additional recurring notifications

CRON Notification URL

  • read-only URL generated from the get_expired_carts action ID
  • this URL must be called on a schedule to process notifications

Debug settings

  1. Notification debug (notification_debug, yes/no)

- when yes, carts are not marked as checked/expired-incremented - useful for repeated test runs against same cart dataset

CRON Processing

Action method: get_expired_carts

Initial staged notifications

  • reads notification_events
  • sorts by notify_minutes
  • for each row, finds carts where:
  • order_id IS NULL (not completed)
  • expired = <grid row index>
  • email_address present
  • cart timestamp older than configured minute threshold
  • cart payload length indicates non-empty cart
  • sends configured template+subject for that row

Additional recurring notifications

  • runs up to notification_attempts
  • uses additional reminder path after staged rows are exhausted
  • sends through standard CartThrob notification event path when no custom row template is passed

Order-state tracking hooks

  • cartthrob_add_to_cart_start updates cart row with email, resets expired to 0, clears order_id
  • cartthrob_on_authorize writes order_id so completed carts stop matching abandoned-cart queries

Known setting mismatch in current code

Control Panel stores notify_every, but processor reads check_expired for additional cadence. If check_expired is not set, code falls back to 7 * attempt_number days.

Notification Template Variables

Notification payload includes customer/cart data and CartThrob cart-info totals.

Commonly used values (from live docs and current processing path):

  • customer contact fields: first_name, last_name, email_address, phone, address/shipping fields
  • cart totals: total, subtotal, tax, shipping, discount
  • cart item loop: items with item fields such as entry_id, quantity, price, title
  • cart metadata: url, id
  • CartThrob cart_info variables (formatted totals and counts)

Testing and Debugging

Suggested test loop:

  1. Add at least one notification event.
  2. Set a short threshold (for example, 1 minute).
  3. Enable debug mode.
  4. Build a cart while logged in with a known email.
  5. Wait past threshold.
  6. Call CRON URL manually.
  7. Verify email delivery and variable rendering.
  8. Repeat while debug mode is on.

Changelog

Version 2.1.0

Released June 9, 2021

  • ADDED: ExpressionEngine 6 support.

Version 2.0.0

  • ADDED: ExpressionEngine 5 support.

Version 1.07

  • FIXED: issue where settings would not save.
  • FIXED: issue where adding a new notification could create duplicate rows with limited save/remove behavior.
  • ADDED: additional item and totals variables available in notifications.
  • FIXED: issue where debug setting was ignored.