Set Up SendGrid
SendGrid connects to Mailrith with an API key. Configure the Event Webhook so subscriber statuses stay in sync when bounces or spam complaints occur.
Before You Start
SendGrid connects to Mailrith with an API key. SendGrid sends delivery events to Mailrith through the SendGrid Event Webhook. Before you create the connection, prepare these items in SendGrid:
- A verified sender or authenticated domain: the From email in Mailrith must be allowed to send from SendGrid.
- An API key: create a key with permission to send mail.
- Event Webhook access: Mailrith needs this access to receive bounce, dropped, and spam report events from SendGrid.
- A test inbox: send a test email to this inbox to confirm Mailrith can send through SendGrid before you use the connection for real campaigns.
If you have not used SendGrid with your domain before, complete sender authentication first. A valid API key cannot send mail if SendGrid does not allow the From email.
Mailrith Fields
In Mailrith, click Email Delivery Connections in the left sidebar, click Create Connection, choose SendGrid in Select Email Delivery Service, and enter these fields in Connect Email Delivery Service:
- Connection name: an internal label for the connection, such as "SendGrid Marketing".
- API Key: the SendGrid key that has permission to send mail.
- From name: the sender name subscribers see in their inbox.
- From email: the sender address that SendGrid has approved.
- Workspaces: the workspaces that can send email through this connection.
SendGrid Setup
- Sign in to SendGrid and open the account that will send Mailrith email.
- Confirm the sender identity before you create the Mailrith connection. For long-term sending, use SendGrid domain authentication when possible. For testing only, you can use a verified single sender, but the From email in Mailrith must match a sender that SendGrid allows.
- If you use domain authentication, open SendGrid's sender-authentication area, start domain authentication, choose your domain, and add the DNS records from SendGrid at your DNS provider. Wait until SendGrid shows your domain as verified, then test the connection in Mailrith.
- Open Settings in the SendGrid left sidebar, then open API Keys.
- Click Create API Key.
- Name the key clearly, such as Mailrith sending or Mailrith production sender.
- Choose permissions for the key. Use restricted permissions if your SendGrid plan and account settings allow them, and give the key permission to send mail. Do not give broad account access unless your team has approved that access.
- Click Create & View or the equivalent SendGrid action that creates the key and shows the key value.
- Copy the API key immediately because SendGrid only shows the full key once.
- Return to Email Delivery Connections in Mailrith, click Create Connection, and choose SendGrid.
- Paste the API key, enter the From name, enter the SendGrid-approved From email, assign workspaces, and click Save.
- Use Send Test Email from the connection row before you use the connection in a broadcast, sequence, or automation.
If the test fails, check that the API key has permission to send mail, the sender or domain is verified in SendGrid, the SendGrid account is active, and the From email exactly matches a sender or authenticated domain that SendGrid allows.
Event Webhook
SendGrid's Event Webhook tells Mailrith when a subscriber bounces, is dropped, or reports spam. Mailrith uses these events to update subscriber status and protect future sends.
- In Mailrith, click Email Delivery Connections, click Webhooks on the SendGrid connection, and copy the delivery-event webhook URL exactly.
- In SendGrid, open Settings, then open the Event Webhook settings.
- Create a new event webhook, or edit the existing event webhook used for this sender.
- Paste the Mailrith delivery-event URL as the endpoint URL.
- Enable bounce, dropped, and spam report events. You can also enable delivered, deferred, opened, or clicked events if your team wants provider-side reporting, but Mailrith needs the problem events to protect subscribers.
- Save the webhook and confirm that SendGrid shows the webhook as enabled.
- After the next test or small send, check SendGrid's webhook activity if Mailrith does not show delivery events.
If Mailrith is not receiving events, check that the endpoint URL exactly matches the Mailrith delivery-event URL, the webhook is enabled in SendGrid, and the selected SendGrid events include bounce, dropped, and spam report events.