Sending
Connect SendGrid
SendGrid is one of the largest transactional email providers globally. One API key and you are live.
Overview
SendGrid authenticates entirely via API key. If you have multiple from addresses, you can use a single API key for all of them as long as each from address or domain is verified in SendGrid as a Sender Identity. You can optionally set an IP Pool to route sends through a dedicated IP.
Get your credentials
- Log in to app.sendgrid.com
- Go to Settings → API Keys → Create API Key
- Choose Restricted Access and grant Mail Send → Full Access
- Copy the key — it is only shown once
- Verify your from address: Settings → Sender Authentication → Domain Authentication (preferred) or Single Sender Verification
DOMAIN AUTHENTICATION
Add the provider in Nudgel
- Go to Settings → Providers
- Click Add a provider
- Pick SendGrid
- Fill in the fields:
| Field | Required | Notes |
|---|---|---|
from_email | Yes | A verified sender identity email address |
from_name | Yes | Display name shown in email clients |
ip_pool_name | No | SendGrid IP pool name. Only needed if you have dedicated IPs and want to route through a specific pool. |
api_key | Yes | Restricted API key with Mail Send access. Encrypted at rest. |
Test the connection
curl -X POST https://api-raven-cloud.autotribes.app/v1/messages \
-H "X-Raven-Key: rk_live_a3f7b2c1_..." \
-H "Content-Type: application/json" \
-d '{
"channel": "email",
"to": "you@example.com",
"from": "noreply@mail.acme.co.ke",
"subject": "Nudgel test — SendGrid",
"bodyHtml": "<p>If you can read this, SendGrid is wired up.</p>",
"bodyText": "If you can read this, SendGrid is wired up."
}'Confirm in SendGrid → Activity — the message should appear in the activity feed within seconds.
Set up webhooks
SendGrid calls this feature Event Webhook. Configure it under Settings → Mail Settings → Event Webhook.
Set the HTTP Post URL to:
https://api-raven-cloud.autotribes.app/v1/webhooks/email/sendgrid/{YOUR_TENANT_ID}Enable at minimum: Delivered, Bounce, Spam Report, Unsubscribe. Hard bounces and spam reports are automatically added to your suppression list. See the webhooks guide for full details.
Verify your sending domain at SendGrid
To send from your own domain (e.g. mail.example.co.ke) through SendGrid, publish DKIM records SendGrid generates for you. Nudgel orchestrates this from one dashboard.
- In Nudgel dashboard, go to
Settings → Sending domains → Add domain, enter your domain. - On the next screen, select SendGrid. Nudgel calls SendGrid's domain registration API using your credentials and shows you the DNS records to publish.
- Publish the records at your DNS host (Cloudflare, Route 53, etc.).
- Nudgel polls every 30 seconds for the first 10 minutes, then hourly. Verification surfaces in the dashboard automatically.
Add this to your SPF record
include:sendgrid.net to your existing SPF record (or create a new v=spf1 include:sendgrid.net -allif you don't have one).SendGrid-specific notes
- SendGrid domain auth uses 3 CNAMEs:
mail_cname,dkim1, anddkim2. All three must be published. - SendGrid may take up to 48 hours to fully validate after DNS propagation.
- Automatic DKIM key rotation is enabled by default (
automatic_security: true) — no manual key rotation is required.
Full setup walkthrough: Sending domains setup
Troubleshooting
| Symptom | Most likely cause |
|---|---|
failed — "The from address does not match a verified Sender Identity" | Verify the from address in SendGrid (domain auth or single sender). |
failed — "Unauthorized" | API key is wrong or does not have Mail Send permission. |
failed — "Forbidden" | IP pool name does not exist, or account is suspended. |
| Messages land in spam | Complete SendGrid's Domain Authentication. See sending domains. |