Digests
For simple use cases of a digest, we have included a new digest feature that does not require automations; you can view it here.
It is available for our business and enterprise customers and requires reaching out to Courier Support or your account team 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.
Configure a digest in preferences
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.
Schedules
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.
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.
- 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
}
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
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.
Add to digest
First step is to configure an automation to add events to the digest. Open an automation template, right click on the canvas, and select the Add to Digest
. From the configuration panel, select the subscription topic with the digest configured. This will add any event that comes in to that digest by user.
Note: currently user_id
and userId
are accepted in the event data
Digest trigger
Second step is to configure an automation to release and interact with the digested events data. Open an automation template, select the rounded trigger node,and select in the Digest
type under the Trigger
section. Select the subscription topic with the digest configured. This automation template will now be invoked on any scheduled intervals configured for that digest. Reminder: digests are done at the user level so each invocation will be for a particular user based on the default schedule or the schedule they selected in preferences
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
}
Tutorial
Below you can find a walkthrough of a sample digest flow using automations and preferences.