Skip to content

Automations

Automations allow you to send e-mails to your client based on their actions. For example, a welcome email when a customer creates a new account.

Configuring automations is a requirement for proper functionality of customer-related actions such as e-mail activation.

You can find the Automations management in Administration, Revenue Configuration, Automations tab.

Below is a list of standard automation triggers available in your CMS. These triggers can be used to initiate automated actions, notifications, or workflows based on user and system events.

Trigger IDDescription
order_newSuccessful new order
order_renewSuccessful renewal
order_new_failFailed new order
abandoned_cartAbandoned cart
order_renew_failFailed renewal order
renewalcron_failNightly renewal failure
renewalcron_successNightly renewal successful
customer_createNew customer registration
customer_activateCustomer e-mail activation request
customer_activate_completeCustomer e-mail activation complete
customer_forgotpasswordCustomer forgot password e-mail
customer_membership_anniversaryCustomer creation anniversary
customer_new_subscriptionNew subscription
customer_deactivate_subscriptionSubscription deactivated
newsletter_new_activateNew newsletter opt-in: activation request
newsletter_new_completeNew newsletter opt-in: complete
newsletter_readRead a newsletter or e-mail alert
form_{formId}Form submission was made
customer_deleteCustomer account deletion,
customer_updateCustomer account details update,
customer_changed_password'Customer password change,
customer_update_subscriptionSubscription updated
customer_card_expiryCustomer card expires this month
content_createCreate new content
content_updateUpdate content
content_publishPublish content
content_unpublishUnpublish content
content_deleteDelete content

You may decide to start a delayed automation. You can specify this in number of hours in the Delay parameter. For example, you wish to send a welcome e-mail reminding a user to visit your website again, 72 hours after they register.

Automations can be sent to various destination. They can work as a notification to your customers or as a notification to your staff. For example, you might want to configure an e-mail to go out to the customer when a renewal fails. You can also alert your customer servicing desk by adding their e-mail address.

Webhooks are also possible to notify your custom application of this event. You will receive a POST request with a body in JSON format. The body of the event contains the following parameters:

  • automationId: ID of the Automation that triggered this alert
  • queueId: Unique ID for this webhook notification
  • parameters: An object containing additional parameters sent by this trigger
  • timestamp: A date-time string of the current time of execution, in YYYY-mm-dd HH:mm:ss format.
  • subject: The subject of the notification as configured in the backend.

The parameters object can contain one of more of the following fields. You must check if the field is present, then you can use it.

  • trigger_id: Trigger ID, refer to the table above.
  • runtime_conditions: The conditions that were evaluated when the trigger runtime is scheduled. These are different from the initial_conditions which are not shown in the API. Initial conditions are evaluated when the trigger happens. Runtime conditions are evaluated after a delay of time.
  • email: Customer e-mail address that received this notification via email.
  • recipients_emails: Administrator e-mail addresses configured to receive this automation.

For content related triggers:

  • article_id: Article ID or Content ID

For customer related triggers:

  • visitor_id: Customer ID

For order related triggers:

  • visitor_id: Customer ID
  • order_id: Order ID
  • subscription_id: Subscription ID if present

For subscription related triggers:

  • visitor_id: Customer ID
  • subscription_id: Subscription ID

For Form submission triggers:

  • form_id: ID of the Form
  • submission_id: ID of the submission
  • visitor_id: Customer ID

For e-mail list triggers:

  • channel_id: ID of the Social Channel
  • channel_post_id: Available when a Social Post is opened or read

For “forgot your password” and “email activation request” triggers:

  • code: Activation code to send with your API call

For nightly renewal success or failure:

  • logs: JSON-encoded array of log messages
  • total: Total subscriptions found for renewal
  • success: Total subscriptions renewed without errors

For protection against spam filters, we provide two e-mail addresses to send your messaging from. Please make sure to select the Marketing e-mail address if you are sending marketing materials.

If a user is opted out from marketing (global suppressions list), they will not receive e-mails that use the Marketing e-mail address.

TO specify a template, create a content with type E-mail. Then select this e-mail from the automation editor.

There are various macros presented to you in the e-mail builder tool. These are available for use in any environment (i.e. in Automations and in Social Posts). However, more macros are available for the automations tool. You can find this list below. Some items are marked as objects, which means they provide direct low-level code access to the related object. Our support team can sometimes advise you to use macros based on these objects.

For all triggers with a customer attached to them, including payment triggers, the following macros are available.

  • {{EMAIL}}
  • {{FULL_NAME}}
  • {{FIRST_NAME}}
  • {{LAST_NAME}}
  • {{customer}}
  • {{code}} (Forgot your password and Email activation request triggers)

For all triggers with an attached payment, including subcription triggers, the following macros are available:

  • {{AMOUNT}}
  • {{CURRENCY}}
  • {{order_id}}
  • {{order}}
  • {{cart}} (deprecated)
  • {{price_matrix[‘subtotal’]}}
  • {{price_matrix[‘shipping’]}}
  • {{price_matrix[‘tax’]}}
  • {{price_matrix[‘discount’]}}
  • {{price_matrix[‘total’]}}

For all triggers with an attached subscription, the following macros are available:

While authoring your e-mail, you can also use condition statements to decide whether a container should show for a user or not. The container itself will not be sent in the e-mail’s source.

While inspecting a Container or Columns block in the e-mail builder, navigate to the Condition statement field. You can write condition statements using Smarty-style scripting.

To use a macro in the condition statement, you must prefix it with the dollar sign $.

  1. To check whether a customer has an active subscription, you can write the following statement: $customer.subscriptions|count gt 0

  2. To check if the customer is located in the country ZA: $customer.country_code eq "ZA"

  3. To check if the customer has a profile picture: $customer.photo neq ''

For assistance in writing condition statements, contact our support team.

Modifiers are Smarty functions that can be applied to macros. They start with a | character. For example, macro|count.

The most common ones you could use are:

  • count
  • empty

Use Smarty operators such as gt, lt, gte, lte, neq, eq.

You can use the below functions to check for conditions inside arrays:

Example: in_array(16, $customer.tags) would evaluate to true if the customer has the tag with ID 16 attached to them.

All macros that are objects provide additional properties that can be displayed to the customer or used as conditions.

The object’s structure is the same as the structure you would receive from the API. Below is a list of all properties that you can use.

For arrays, you can apply modifiers. See the modifiers sections.

  • customer.id
  • customer.userId
  • customer.displayName
  • customer.loginName
  • customer.photo
  • customer.country_code
  • customer.preferences
  • customer.country
  • customer.city
  • customer.mobile
  • customer.dateOfBirth
  • customer.user_type
  • customer.creationDate
  • customer.archiveCredits
  • customer.subscriptions (array)
  • customer.subscriptions[n].id
  • customer.subscriptions[n].activationDate
  • customer.subscriptions[n].deactivationDate
  • customer.subscriptions[n].status
  • customer.subscriptions[n].product
  • customer.subscriptions[n].product.description
  • customer.subscriptions[n].purchased_item
  • customer.subscriptions[n].purchased_item.name
  • customer.subscriptions[n].nextRenewal
  • customer.subscriptions[n].lastFailedOrder
  • customer.subscriptions[n].attempts
  • customer.subscriptions[n].referenceOrderId
  • customer.subscriptions[n].group
  • customer.subscriptions[n].group_name
  • customer.subscriptions[n].paymentMethod
  • customer.active
  • customer.clientId
  • customer.fields (key-value pair)
  • customer.tags (array)
  • customer.tags[n] (ID of the tag)
  • customer.segments (array)
  • customer.segments[n] (ID of the segment)
  • order.id
  • order.price
  • order.status
  • order.responseMessage
  • order.lastUpdate
  • order.timestamp
  • order.userId
  • order.paymentMethod
  • order.cart (deprecated)
  • order.price_matrix
  • order.price_matrix.subtotal
  • order.price_matrix.tax
  • order.price_matrix.discount
  • order.price_matrix.shipping
  • order.price_matrix.total
  • order.items_details (array)
  • order.items_details[n].item
  • order.items_details[n].price
  • order.items_details[n].quantity
  • order.items_details[n].item.description
  • order.shippingStatus
  • order.authorization
  • order.address
  • order.shipping_address
  • order.shipping_price
  • order.tax_price

Inside a Container or Columns block that has a data source set to: Product Items, you can use the below macros:

  • item.price
  • item.quantity
  • item.item.description
  • subscription.id
  • subscription.activationDate
  • subscription.deactivationDate
  • subscription.status
  • subscription.product
  • subscription.product.description
  • subscription.purchased_item
  • subscription.purchased_item.name
  • subscription.nextRenewal
  • subscription.lastFailedOrder
  • subscription.attempts
  • subscription.referenceOrderId
  • subscription.group
  • subscription.group_name
  • subscription.paymentMethod