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
Webhook Secret
Section titled “Webhook Secret”The administrator can configure a webhook secret for automations. When configured, the system will use this secret to generate a SHA256 HMAC of the JSON payload. This signature is included in the request headers as X-Webhook-Signature. The header value is in the format sha256=<hash>.
You can use this signature to verify that the request originated from the system. Below is a sample implementation in JavaScript showing how to validate the signature:
const crypto = require('crypto');
/** * Validates the webhook signature * @param {string|Buffer} payload - The raw request body * @param {string} signatureHeader - The value of X-Webhook-Signature header * @param {string} secret - Your configured webhook secret * @returns {boolean} - True if signature is valid */function validateWebhookSignature(payload, signatureHeader, secret) { if (!signatureHeader || !secret) { return false; }
const hmac = crypto.createHmac('sha256', secret); const digest = 'sha256=' + hmac.update(payload).digest('hex');
// Use timingSafeEqual to prevent timing attacks const signatureBuffer = Buffer.from(signatureHeader); const digestBuffer = Buffer.from(digest);
if (signatureBuffer.length !== digestBuffer.length) { return false; }
return crypto.timingSafeEqual(signatureBuffer, digestBuffer);}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.
Working with emails
Section titled “Working with emails”You can customize your e-mails by following the E-mail templates guide.