Skip to main content

SendGrid

Profile Requirements

To deliver a message to a recipient over SendGrid, Courier must be provided the recipient's email address. This value should be included in the recipient profile as email.

JSON
// Recipient Profile
{
"email": "example@example.com"
}

Email Activity Tracking

For the SendGrid configuration, the toggle, Enable Email Activity Tracking via Polling, will allow Courier to use SendGrid’s Email Activity API to periodically check on the delivery status of sent emails. The API Key must have Read Access to the Email Activity, and the SendGrid account must have the additional email history add-on enabled. See the documentation for API Keys and Email Activity to ensure the SendGrid account is set up correctly.

Enable read access to Email Activity on the API Key.
Upgrade the plan to include extended email activity history.

Override

Overrides can be used to change the request body that Courier uses to send an email. Overrides are useful when a field is not yet supported by Courier or you would like to override the value that Courier generates. You can override any of the fields supported by SendGrid's /mail/send endpoint (see all v3 mail send request body fields here). Below is an example of overriding the subject and adding an attachment:

JSON
{
"event": "<COURIER_NOTIFICATION_ID>",
"recipient": "katherine_pryde",
"profile": {
"email": "kpryde@xavierinstitute.edu"
},
"data": {
"name": "Katherine Pryde"
},
"override": {
"sendgrid": {
"body": {
"subject": "Requested file - lockheed.json",
"attachments": [
{
"content": "eyJmb28iOiJiYXIifQ==",
"type": "application/json",
"filename": "lockheed.json"
}
]
},
"config": {
"apiKey": "<your API Key>"
}
}
}
}
Was this helpful?