NOTE

Status: This product is under active development and is available in a Private Beta, please contact Courier support for access.

Courier Automations can be leveraged to create recurring user digests on configured intervals. This can be useful for things like weekly reports or user digests, while also offering user schedule preferences if desired.

Prerequisite: Configure a Digest in the Preferences Editor

The first step is to configure a digest with at least one schedule in the Preferences Editor. In the Preferences Editor, either create a new subscription topic or open the settings of an existing one.

Configure digest release schedule

In the digest section click on schedules. This is where you define the schedule(s) at which the digest will be released. One schedule is required here however multiple schedules can be configured to give your users preference. If you have multiple schedules configured, these will show in the hosted preferences page as options for the user to select. Note: the date-time picker is currently configured in local timezone. Users viewing our hosted preference page, or using our front-end preference components will also see as their local timezone.

Digest Schedules

Configure Digest Categories

Categories provides the ability to separate disparate data within the same digest. For example, you may want to sort by likes and comments for a weekly digest of the blog posts with the most engagement. Each category has a retain setting. This describes the specific events that will be retained when the digest is released. 10 highest/10 lowest require a sort_key which is a data attribute in the event we will use to sort the events by.

Digest Categories

  • first 10: the first 10 events that come in
  • last 10: the last 10 events that come in
  • 10 highest: The 10 highest events sorted by a specific data attribute
  • 10 lowest: The 10 lowest events sorted by a specific data attribute The default value is digest and will retain the first 10 items. When the digest is released, it will be sent with the following format:
[category_key]: {
  count: <total number of events>
  items: [...] // the individual events that match the retain setting. Maximum length of 10
}

Configure Other Digest Settings

Settings has a toggle to invoke the digest when empty for users within an audience. Typically the digest will only send to users that had events come in during the schedule window. This option means that users in the audience will have a digest sent to them even if there were no events matching their user_id. This can be useful for fetching your own data in the automation and sending the digest to your users with that custom data

Digest Settings

Working with Digests in Automations

Now that we have a digest configured in preferences, lets talk about adding events to the digest. There are two automation nodes that will be used to add/release digest events.

Digest Event Collection

Configure an automation to gather events for the digest. In your automation template, add an “Add to Digest” node by right-clicking on the canvas and selecting it from the menu. In the configuration panel, choose the subscription topic where you’ve set up the digest. This node will accumulate events for each user, identified by their user_id or userId in the event data. Note: currently user_id and userId are accepted in the event data

Automation Add to Digest

Digest Release

Create an automation to process and send the compiled digest. In a new automation template, select the rounded trigger node and choose the “Digest” type from the “Trigger” section. Select the same subscription topic you used for event collection. This automation will activate according to the scheduled intervals you’ve configured for the digest, processing data for each user based on their default or selected schedule in preferences.

Automation Digest Trigger

The digest data payload will come into the automation in the structure

[category_key]: {
  count: <total number of events>
  items: [...] // the individual events that match the retain setting. Maximum length of 10
}