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.
Backend
Section titled “Backend”You can find the Automations management in Administration, Revenue Configuration, Automations tab.
Triggers
Section titled “Triggers”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 ID | Description |
|---|---|
order_new | Successful new order |
order_renew | Successful renewal |
order_new_fail | Failed new order |
abandoned_cart | Abandoned cart |
order_renew_fail | Failed renewal order |
renewalcron_fail | Nightly renewal failure |
renewalcron_success | Nightly renewal successful |
customer_create | New customer registration |
customer_activate | Customer e-mail activation request |
customer_activate_complete | Customer e-mail activation complete |
customer_forgotpassword | Customer forgot password e-mail |
customer_membership_anniversary | Customer creation anniversary |
customer_new_subscription | New subscription |
customer_deactivate_subscription | Subscription deactivated |
newsletter_new_activate | New newsletter opt-in: activation request |
newsletter_new_complete | New newsletter opt-in: complete |
newsletter_read | Read a newsletter or e-mail alert |
form_{formId} | Form submission was made |
customer_delete | Customer account deletion, |
customer_update | Customer account details update, |
customer_changed_password' | Customer password change, |
customer_update_subscription | Subscription updated |
customer_card_expiry | Customer card expires this month |
content_create | Create new content |
content_update | Update content |
content_publish | Publish content |
content_unpublish | Unpublish content |
content_delete | Delete 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.
Recipients
Section titled “Recipients”E-mails
Section titled “E-mails”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
Section titled “Webhooks”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 alertqueueId: Unique ID for this webhook notificationparameters: An object containing additional parameters sent by this triggertimestamp: 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 theinitial_conditionswhich 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 IDorder_id: Order IDsubscription_id: Subscription ID if present
For subscription related triggers:
visitor_id: Customer IDsubscription_id: Subscription ID
For Form submission triggers:
form_id: ID of the Formsubmission_id: ID of the submissionvisitor_id: Customer ID
For e-mail list triggers:
channel_id: ID of the Social Channelchannel_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 messagestotal: Total subscriptions found for renewalsuccess: Total subscriptions renewed without errors
Sending identity
Section titled “Sending identity”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.
Template
Section titled “Template”TO specify a template, create a content with type E-mail. Then select this e-mail from the automation editor.
Macros
Section titled “Macros”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.
Customer triggers
Section titled “Customer triggers”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)
Payment triggers
Section titled “Payment 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’]}}
Subscription triggers
Section titled “Subscription triggers”For all triggers with an attached subscription, the following macros are available:
- {{subscription_id}}
- {{subscription}}
Condition statements
Section titled “Condition statements”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 $.
Examples
Section titled “Examples”-
To check whether a customer has an active subscription, you can write the following statement:
$customer.subscriptions|count gt 0 -
To check if the customer is located in the country ZA:
$customer.country_code eq "ZA" -
To check if the customer has a profile picture:
$customer.photo neq ''
For assistance in writing condition statements, contact our support team.
Modifiers
Section titled “Modifiers”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
Operators
Section titled “Operators”Use Smarty operators such as gt, lt, gte, lte, neq, eq.
Functions
Section titled “Functions”You can use the below functions to check for conditions inside arrays:
in_array
Section titled “in_array”Example:
in_array(16, $customer.tags)
would evaluate to true if the customer has the tag with ID 16 attached to them.
Objects
Section titled “Objects”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 object
Section titled “Customer object”- 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 object
Section titled “Order object”- 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
Item object
Section titled “Item object”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 object
Section titled “Subscription object”- 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