Notifications

Overview

CartThrob includes a notifications system which allows you to send automatic notifications when specific events occur. The content of these notifications is stored in standard EE templates. Each event includes several unique variables that can be used in the templates. Those variables are noted in the [notification events][#notification-events] documentation below.

You can create multiple notifications to be sent to different people. Because all notifications are standard EE templates, you can get very creative with the contents of the email. Please keep in mind though, that because they are EE templates, the more time it takes to render the email, the more time it will take the customer to wait while these notifications are being sent in the background.

To configure a new notification

  1. Create a template that will contain the content of the email to be sent
  2. In CartThrob's notifications settings, click "Add Another Row" at the bottom of the notifications panel to add a new notification
  3. Add a subject line, from name, from email address, to email (use a [variable][#variables] if needed).
  4. Select the template you created
  5. Select the event that should trigger the email.
  6. If you are sending an order status change notification, set the original and new statuses that should trigger the event (more on this below)
  7. Select the email type. HTML gives you more control over look and feel, but Plain Text is accepted by more mail systems

Variables

The backend settings for notifications use the following variables

customer_name

The full name of the customer

{customer_name}

customer_email

The email address of the customer.

{customer_email}

Use these variables in the from name, from email, to email fields as needed.

Notification Events

CartThrob includes the following event notification types by default. CartThrob addons may register additional notification events, and these will automatically be added to the events list.

Payment Trigger Events

All payment triggered event email templates should use the submitted_order_info tag to output information about the order in process. The submitted order info tag can be used to output the order's entry id, and other information from that channel entry. See submitted_order_info tag for more detail

Low Stock Warning

Low stock warning email templates can use the following additional variables to output information about the item and its inventory level

entry_id

the entry id of the item

{entry_id}

inventory

the inventory level at present

{inventory}

This email is sent whenever the low-stock level is reached. This level is set in the products settings > product options section.

Order Status Has Changed

When an order entry's status is changed, a notification can be sent. You can send a notification when ANY status changes, or when specific status changes take place. For instance, you could send a status notification when an order is changed from Backordered to Shipped. Or you could send a different notification when the status is changed from Completed to Refunded. The following variables are available by default in an order status notification template.

entry_id

order id that has changed

{entry_id}

status

the current status of the order

{status}

previous_status

the previous status of the order (if it changed)

{previous_status}

channel_id

the channel ID of the orders channel

{channel_id}

url_title

the url title of the order entry

{url_title}