Sending a digest notification using Courier automations.

Use automations to fetch data and render it in a group digest or send a digest with recipient-specific data to every member of a list.

Rodrigo Rojas avatar
Written by Rodrigo Rojas
Updated over a week ago

Generic Digest

Use Courier automations to fetch data and render it in a notification to every recipient in the list.

A generic digest is when every recipient in the list receives the same notification with the same data. To automate a generic digest, simply define a fetch-data step, followed by a send-list step. The data that is fetched, will be used to render a notification that is sent to each recipient.

This automation definition can be saved as a template and scheduled to be invoked on any recurring interval or once on a specific date.

{
"automation": {
"steps": [
{
"action": "fetch-data",
"webhook": {
"url": "https://main.app/digest"
},
"merge_strategy": "replace"
},
{
"action": "send-list",
"list": "TEAM-LIST",
"template": "WEEKLY-GENERIC-DIGEST"
}
]
}
}

Recipient Digest

A recipient digest is when every recipient in the list receives a unique notification with recipient-specific data.

To automate a recipient digest, define a send-list step with a data_source property. Specific data will be fetched for each recipient and will be used to render a notification that is sent to each recipient. Note that thedata_source.url should accept a recipientId query string parameter.

This automation definition can be saved as a template and scheduled to be invoked on any recurring interval or once on a specific date.

{
"automation": {
"steps": [
{
"action": "send-list",
"list": "TEAM-LIST",
"template": "WEEKLY-RECIPIENT-DIGEST",
"data_source": {
"webhook": {
"url": "https://main.app/digest",
"method": "GET"
},
"merge_strategy": "replace"
}
}
]
}
}

Example recipient digest

As an example, you could use the recipient digest to send a weekly update to students of an online school platform.

By calling the data source, and getting the following payload:

{
"data": {
"title": "Weekly Progress Report",
"username": "Count von Count",
"school": "B.Birds's Online Math Academy",
"nums": 1,
"courses": [
{
"name": "Counting",
"progress": "90%",
"grade": "A+"
}
]
},
"profile": {},
"override": {}
}

You could send the following notification with each individual student's progress:

Did this answer your question?