Webhook-Triggered Emails

Ascent360 allows you to trigger emails through a webhook, enabling you to send event-based emails and include dynamic data in the payload. This article walks through preparing your email with merge tags and configuring the webhook trigger settings.

For guidance on sending, testing, and managing webhook-triggered emails after setup, see Sending and Testing Webhook-Triggered Emails. For advanced payload techniques, see Advanced Techniques for Webhook-Triggered Emails.

Important: Avoid Clicking Webhook URLs During Setup

When setting up webhook-triggered emails that send to an audience (rather than a single recipient specified in the payload), clicking the webhook URL directly in your browser is enough to trigger an email send. This is because opening the URL performs a GET request with an empty payload, which will fire the trigger and send the email to your entire audience — with all merge tags rendering as blank.

To avoid unintended sends during setup and testing, always copy and paste the webhook URL rather than clicking it directly.

Why Use a Webhook to Trigger an Email?

Triggering an email from a webhook allows you to go beyond the standard email schedule options and gives you granular control over when to send the email, whom to send it to, and what to include in the message. Below are some use cases that may suit your needs.

Send an email whenever an event happens in an upstream system:

  • Website updates (snow reports)
  • Bookings, transactions, or reservations: creation, cancellation, or updates
  • Form submission (for non-Ascent360 forms)

Send an email and dynamically replace content with data from the event payload:

  • Recent snowfall and upcoming forecast
  • Work order updates: technician name, comments, and estimated completion time
  • Shipping updates: tracking ID and URL
  • Booking creation: confirmation ID, arrival date and time, special instructions

Prepare Your Email with Merge Tags

Using a webhook, you can add personalization to your email and pass in data in a payload that wouldn't normally be available in the Customer Data Platform (CDP). During the sending process, you will have an opportunity to map these merge tags to your payload if needed.

Merge tags can be inserted via three methods:

  1. Use the text formatting toolbar within the email editor to click Merge Tags, then select your CDP field from the list and designate a default value.
  2. Use the text formatting toolbar to click Merge Tags, then select Custom and name your merge tag and provide a default value (if applicable).
  3. Manually declare a merge tag by typing the merge tag syntax. Examples below:
{{[myMergeTag]}}
{{[myMergeTag|"defaultValue"]}}

Custom or manually-declared merge tags should have unique names that are not shared with other fields in your CDP. Your merge tag name should be alphanumeric and contain no spaces.

The Email Send will account for the text styling changes made in the editor, including font style, size, color, highlight, etc. 

In the Editor:Live Send:

Enable a Webhook-Triggered Email

Once your email design is finalized, select Triggered Email from the Email Send dialogue.

Send To Section

In the Send To section, select whether this email will go to an audience or whether recipients will be provided in the webhook payload.

Option 1 - Send to an Audience: Select a saved audience from the drop-down. Select this option if email recipients will not be provided from the system that is triggering the webhook (instead they are sourced from existing individuals in a CDP audience). 

Option 2 - Custom Recipient: Provide a recipient in the webhook payload. Select this option if the email address for the recipient will be provided from the system that is triggering the webhook. This option supports one recipient per webhook trigger.

Important:

  • If you send to an audience, Ascent360 will evaluate email permissions before sending the email.
  • If you provide the recipient in the payload, Ascent360 will not evaluate CDP email permissions before sending the email. It is your responsibility to ensure that email addresses you are providing are eligible for email communication through this method.

From Section

Select your From Name, From Address, and Reply To Address for this triggered email.

Properties Section

Configure your email properties, including your Subject, Pre-header, and Tracking Parameters.

Configure the Trigger and Payload Mapping

The Trigger section displays options to view the suggested payload format or provide a payload and mapping.

Using the Suggested Format

If you don't already have a predetermined payload that you plan on using, use the suggested format. The suggested format represents the combination of merge tags ( {{[mergeTag]}} ) in the email and the email recipient, if applicable; these are the JSON keys and values that Ascent360 will expect when evaluating for recipients and merge tags. Not every key needs to have a value (see Merge Tag Precedence in Sending and Testing Webhook-Triggered Emails), but each key in your payload needs to match exactly what is shown (spelling, spacing, and capitalization) on this page. Additional keys included in the payload will be ignored.

The payload keys and values only apply to merge tags within the email body itself. Changing email properties (subject, from name, from email address) via the payload is not supported.

Providing a Custom Payload

If you aren't able to conform your payload to the suggested format, you can provide a payload and tell Ascent360 how to locate the data that is relevant to the email.

JSON is the only accepted payload format.

Note: If you selected the option to send to an audience, sending a payload with the webhook is entirely optional. If you have merge tags that you want to dynamically swap, you will want to provide that data in the payload.

To provide a custom payload:

  1. Click Provide a Payload, then paste your JSON data.
  2. Click Validate & Map to enter the mapping interface.
  3. In the mapping interface, you will see a list of your merge tags on the right side (anything that follows the {{[mergeTag]}} syntax).
  4. Within the payload, expand the nodes of the JSON tree to locate the relevant data.
  5. Drag the data from the left side to the corresponding input for that field on the right side. Ascent360 will input the JSON path that will be used to locate the data in subsequent triggers. In order to be dragged, your sample data field needs to have data in it (the interface will not detect nulls).
  6. Repeat this process for each of the merge tags you need to map.

You may decide to skip the mapping for CDP Field merge tags (see Merge Tag Precedence in Sending and Testing Webhook-Triggered Emails). Other data in the payload that is not identified in the mapping will be ignored for future triggers.

You may drag into already-filled inputs to overwrite the input or click the green check mark next to the data to clear the input.

Once you have decided to follow the suggested schema or provided your own payload example with mapping, close the Trigger section and click the Continue button in the top right. After confirming, Ascent360 will produce a webhook to be used for this email. This webhook is live and can be used immediately.

For more information on sending and testing webhook-triggered emails, see Sending and Testing Webhook-Triggered Emails.