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

  1. Log in to app.sendgrid.com
  2. Go to Settings → API Keys → Create API Key
  3. Choose Restricted Access and grant Mail Send → Full Access
  4. Copy the key — it is only shown once
  5. Verify your from address: Settings → Sender Authentication → Domain Authentication (preferred) or Single Sender Verification

DOMAIN AUTHENTICATION

SendGrid's Domain Authentication adds DKIM records to your DNS and marks your domain as trusted. It is strongly recommended over single sender verification — deliverability is noticeably better. You can manage this directly in SendGrid, or use Nudgel's sending domains feature for DKIM/SPF across all providers.

Add the provider in Nudgel

  1. Go to Settings → Providers
  2. Click Add a provider
  3. Pick SendGrid
  4. Fill in the fields:
FieldRequiredNotes
from_emailYesA verified sender identity email address
from_nameYesDisplay name shown in email clients
ip_pool_nameNoSendGrid IP pool name. Only needed if you have dedicated IPs and want to route through a specific pool.
api_keyYesRestricted API key with Mail Send access. Encrypted at rest.

Test the connection

curl
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:

text
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.

  1. In Nudgel dashboard, go to Settings → Sending domains → Add domain, enter your domain.
  2. On the next screen, select SendGrid. Nudgel calls SendGrid's domain registration API using your credentials and shows you the DNS records to publish.
  3. Publish the records at your DNS host (Cloudflare, Route 53, etc.).
  4. Nudgel polls every 30 seconds for the first 10 minutes, then hourly. Verification surfaces in the dashboard automatically.

Add this to your SPF record

Append 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, and dkim2. 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

SymptomMost 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 spamComplete SendGrid's Domain Authentication. See sending domains.