Skip to main content

Prerequisites

Setup

1

Create an API key in SendGrid

In SendGrid, open API Keys and create a key with Mail Send permission. Copy it.
Mail Send is all Courier needs to send email, and all the event webhook needs to report delivered. Two optional features want more: template import needs Template Engine, and Email Activity polling needs read access to Email Activity.
2

Add it to Courier

Open the page, select the SendGrid integration, and paste the key into API Key.
3

Set a From Address and save

Add the address SendGrid sends from, such as noreply@acme-corp.com. Select Add Integration, then Save.
Addressing a recipient and sending are the same on every email provider, so they are documented once: and .

Send an email

Address the recipient by email and Courier routes it to SendGrid.

Overrides

covers the two levels and which one wins. lists the fields every email provider takes. An override changes the request Courier sends to SendGrid. Use one to set a field Courier does not support yet, or to replace a value Courier generates. Nest either under providers.sendgrid on the message:

Template import

Import your SendGrid templates from the .
Importing SendGrid Dynamic Templates needs three things:

Import process

With those permissions, the import tool lists your templates as checkboxes. Select the ones to import.

Template Import Page

Delivery tracking

Delivery tracking is off until you set it up. Until then a working SendGrid integration leaves every message at SENT, because Courier has sent the email but has heard nothing back. See . SendGrid can report two ways, and the webhook below is the better one: Use the webhook. Reach for polling only if you cannot add one, and not at all on EU SendGrid.
1

Get Webhook URL

In Courier, open the from the Channels menu. It shows a Webhook URL.
2

Configure SendGrid Webhook

Copy the webhook URL, then log in to SendGrid. Choose Settings, then Mail Settings, then Event Webhooks.Click Create new webhook and fill out the form:
  • Friendly Name - Whatever you like
  • Post URL - Paste the URL you copied from Courier.
  • Deliverability Data - Check all 5 boxes.
  • Security features - Leave these disabled. The HTTPS URL you pasted carries a cryptographic token Courier uses to verify that incoming events are yours.
Press Save.
3

Turn polling off

With the webhook live you no longer need Courier to poll. Wait about an hour first, so in-flight messages do not lose their status updates.Then return to the and switch off Enable polling for status updates and Enable Email Activity Tracking via Polling. Press Save.

Email Activity polling

Polling is the fallback when you cannot add a webhook. Switch on Enable Email Activity Tracking via Polling in the integration settings, and Courier queries SendGrid’s Email Activity API on a schedule for each message’s status. It needs two things on the SendGrid side, and both are easy to miss:

Read access to Email Activity, on the API key.

The email-history add-on, on the SendGrid plan.

If either is missing, SendGrid rejects the query and Courier turns the toggle back off, showing a “Tracking Disabled” callout while messages stay at SENT. EU accounts hit this every time, since EU SendGrid has no Email Activity API. Use the webhook there.

Troubleshooting

Check the to debug provider errors. For anything else, contact Courier Support.
Your API key does not cover the request. Check it against SendGrid’s allowed API key actions.

Solution

Either stay within the actions your key allows, or create a new key that covers the ones you need.Creating a new SendGrid API key with the permissions you wantIn the SendGrid API keys console, select “Create API Key,” then select the permissions in SendGrid’s API key settings.

Creating a new SendGrid API key

SendGrid offers three permission scopes:
  • Full Access
  • Restricted Access
  • Billing Access.
You can also set the access level for each one.
You get this error when the address breaks internet email formatting standards, or does not exist on the recipient’s mail server. It can come from your server or the receiver’s.SendGrid checks the format before sending. If the receiving server cannot find the address, it returns a 550 bounce.Addresses go invalid for several reasons:
  • Typos or misformatting, so the address never reaches a real inbox.
  • The user changed addresses and left the old one empty. Inactivity and lack of engagement are the biggest cause.
  • The inbox provider went out of business, or its server went down for good. Every address on that dead domain is invalid.

Solution

  • Scrub your email lists with an email verification tool to raise deliverability and engagement.
  • Sort your list by why each address signed up. Irrelevant or out-of-date email lowers open and click-through rates.
  • Group contacts by level of engagement. If an address looks like graymail, confirm it is still valid. If not, add it to the unsubscribe list.
  • Create a sunset policy, so you find disengaged contacts regularly and either remove or re-engage them.
SendGrid credits are the emails you can send. One credit per email, renewed at the start of each month. Exceeding your account’s limit raises this error in SendGrid’s SMTP troubleshooting guide.

Solution

Wait for your quota to renew, or upgrade your SendGrid plan for more credits.
Three causes:
  • The username or password in the email client is wrong. The wrong mail server can also cause this.
  • The account is disabled, often for past-due payment or spam complaints.
  • SMTP authentication is not enabled in your email client.

Solution

  • Check your username and password, billing plan, and account status.
  • Check that you confirmed your email address.
  • Configure SMTP authentication.
  • Store your API keys as environment variables. You then change a key in one place instead of hunting for every use.
  • Set up sender authentication for your domains, which gives you SPF and DKIM on the Twilio SendGrid account.
The from address does not match a verified Sender Identity. No email sends until you fix it.

Solution

Authenticate your sender identities in SendGrid’s sender authentication guide. A sender identity is the address recipients see as the sender. Authenticate one or more with Domain Authentication or Single Sender Verification.

Provider details

Courier recommends routing to the channel. Naming this key in routing.channels instead is supported, and sends through just this provider.

Send to a specific provider

When that is worth doing, and what you give up: failover, channel priority, and providers you add later.