Skip to main content

SendGrid

Prerequisites

Prerequisites

Before setting up the SendGrid integration, ensure you have:

Create a SendGrid API Key

SendGrid uses API keys for authentication instead of username/password credentials.

  1. Sign in to your SendGrid account
  2. Navigate to Settings > API Keys in the left sidebar
  3. Click Create API Key
  4. Enter a name for the API key (e.g., dashx-integration)
  5. Choose Full Access or Restricted Access:
    • Full Access: Grants complete access to all SendGrid features
    • Restricted Access: Allows you to specify which permissions to grant
    • For DashX integration, select Mail Send permissions at minimum
  6. Click Create & View
  7. Copy the API key immediately and store it securely
warning

Make sure to securely store your API key. For security reasons, you won't be able to view the API key again after leaving this page. If you lose it, you'll need to create a new one.

Verify your domain

Domain verification in SendGrid allows you to send emails from your domain and improves deliverability.

  1. In the SendGrid dashboard, navigate to Settings > Sender Authentication
  2. Click Authenticate Your Domain
  3. Choose your DNS provider from the dropdown (or select Other if your provider isn't listed)
  4. Enter your domain name (e.g., yourdomainname.com) and click Next
  5. SendGrid will generate DNS records that need to be added to your domain
  6. You'll see several DNS records:
    • CNAME records for domain verification: These verify domain ownership
    • CNAME records for DKIM: These enable DKIM signing
    • TXT record for SPF: This authorizes SendGrid to send emails
  7. Add these records to your domain's DNS settings:
    • Copy the Host and Value from the SendGrid console
    • Add them as the corresponding record type (CNAME or TXT) in your DNS provider
    • The exact process varies depending on your DNS provider (Route 53, Cloudflare, GoDaddy, etc.)
  8. After adding all records, return to the SendGrid console
  9. Click Verify
  10. Verification may take a few minutes to several hours depending on DNS propagation. The status will change from Pending to Verified once SendGrid detects the records
tip

DNS propagation can take up to 48 hours, but typically completes within a few hours. You can check your DNS records using tools like dig or online DNS checkers to verify they're properly configured.

Set up SPF

Sender Policy Framework (SPF) helps prevent email spoofing by specifying which mail servers are authorized to send emails on behalf of your domain.

  1. SendGrid automatically includes SPF configuration in the domain verification process
  2. The SPF record will be included in the DNS records provided during domain verification
  3. If you need to add SPF manually or modify an existing SPF record:
    • In your domain's DNS settings, add or modify a TXT record with the following:
      • Name/Host: @ or yourdomainname.com (depending on your DNS provider)
      • Type: TXT
      • Value: v=spf1 include:sendgrid.net ~all
  4. The include:sendgrid.net part authorizes SendGrid to send emails on behalf of your domain
  5. The ~all means "soft fail" - emails from unauthorized servers will be marked but not rejected
note

If you already have an SPF record, you should modify it to include include:sendgrid.net rather than creating a duplicate. Multiple SPF records are not allowed. For example, if you have v=spf1 include:_spf.google.com ~all, change it to v=spf1 include:_spf.google.com include:sendgrid.net ~all.

Set up DKIM

DomainKeys Identified Mail (DKIM) adds a digital signature to your emails, allowing recipients to verify that emails were sent and authorized by the owner of the domain.

  1. SendGrid automatically includes DKIM configuration in the domain verification process
  2. The DKIM CNAME records will be provided during domain verification
  3. Add the DKIM CNAME records to your domain's DNS settings:
    • Each record will have a name like s1._domainkey.yourdomainname.com and s2._domainkey.yourdomainname.com
    • The values will be CNAME records pointing to SendGrid's DKIM endpoints
  4. After adding the records, SendGrid will automatically detect them and enable DKIM signing
  5. You can verify DKIM status in the Sender Authentication section of your SendGrid dashboard
info

DKIM signing status will show as Verified in the SendGrid dashboard once all CNAME records are properly configured and detected. This typically takes a few minutes to a few hours after adding the DNS records.

Set up DMARC

Domain-based Message Authentication, Reporting, and Conformance (DMARC) builds on SPF and DKIM to provide instructions on how to handle emails that fail SPF or DKIM checks.

  1. In your domain's DNS settings, add a TXT record with the following:
    • Name/Host: _dmarc.yourdomainname.com
    • Type: TXT
    • Value: v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomainname.com
  2. Replace dmarc-reports@yourdomainname.com with an email address where you want to receive DMARC aggregate reports
  3. The p=none policy means "no action" - this is recommended for initial setup to monitor without affecting email delivery
  4. As you gain confidence, you can change the policy to:
    • p=quarantine - Move failing emails to spam/junk folder
    • p=reject - Reject emails that fail DMARC checks
tip

Start with p=none to monitor your email authentication without impacting delivery. Review DMARC reports regularly and gradually tighten the policy as you verify that your legitimate emails are passing SPF and DKIM checks.

Set up BIMI (Optional)

Brand Indicators for Message Identification (BIMI) allows you to display your brand logo in supported email clients, enhancing brand recognition and trust.

  1. Prepare your logo:
    • Create an SVG version of your brand logo
    • The logo must meet BIMI specifications:
      • SVG format
      • Square aspect ratio (1:1)
      • Maximum file size: 32KB
      • Must be publicly accessible via HTTPS
  2. Host the logo:
    • Upload the SVG file to a publicly accessible HTTPS URL (e.g., https://yourdomainname.com/logo.svg)
    • Ensure the server has a valid SSL certificate
  3. Add BIMI record to DNS:
    • In your domain's DNS settings, add a TXT record with the following:
      • Name/Host: default._bimi.yourdomainname.com
      • Type: TXT
      • Value: v=BIMI1; l=https://yourdomainname.com/logo.svg
    • Replace the URL with the actual location of your hosted logo
note

BIMI is currently supported by a limited number of email clients (including Gmail for verified senders). Even if not all clients support it, setting up BIMI doesn't negatively impact email delivery and prepares you for broader adoption.

Configure webhook events (Optional)

SendGrid can send webhook events for email delivery, bounces, opens, clicks, and other events. This is useful for tracking email performance in DashX.

  1. In the SendGrid dashboard, navigate to Settings > Mail Settings
  2. Click on Event Webhook
  3. Configure the webhook:
    • HTTP POST URL: Enter your DashX webhook URL
      • To get the webhook URL: Log in to your DashX workspace, navigate to the Integrations section, find your SendGrid integration, and copy the webhook URL
    • Select the events you want to receive: Choose from:
      • Processed: Email was received and is ready to be delivered
      • Dropped: Email was not sent
      • Delivered: Email was successfully delivered
      • Deferred: Email delivery was temporarily delayed
      • Bounce: Email was bounced
      • Open: Email was opened
      • Click: Link in email was clicked
      • Spam Report: Recipient marked email as spam
      • Unsubscribe: Recipient clicked unsubscribe link
      • Group Unsubscribe: Recipient unsubscribed from a group
      • Group Resubscribe: Recipient resubscribed to a group
  4. Click Save
info

Webhook events are optional but recommended for tracking email performance and engagement metrics in DashX. Without webhooks, you'll still be able to send emails, but you won't receive delivery status updates.

Next steps

After completing the setup:

  1. Verify your email authentication setup: Use free online tools to verify that your SPF, DKIM, and DMARC records are properly configured:

    These tools will help you verify that all DNS records are correctly configured and that your emails will pass authentication checks.

  2. Test email sending: Test sending emails through the DashX console:

    • Log in to your DashX workspace
    • Navigate to the Broadcasts section
    • Create a new Broadcast
    • Select your verified domain as the sender
    • Send a test email and verify that it's delivered
    • Verify that SPF, DKIM, and DMARC authentication passes
  3. Monitor email metrics: Monitor your email performance through the DashX console:

    • Navigate to the Broadcasts section in your DashX workspace
    • View sending statistics, delivery rates, and engagement metrics
    • Monitor bounce and complaint rates to maintain a good sender reputation
    • Use these metrics to optimize your email campaigns
  4. Review SendGrid statistics: Check your SendGrid dashboard for additional insights:

    • Navigate to Activity to see recent email activity
    • View Stats for detailed sending statistics
    • Monitor Suppressions to manage bounces and unsubscribes
tip

SendGrid offers a free tier with 100 emails per day. For higher volumes, consider upgrading to a paid plan. Make sure to monitor your sending limits to avoid hitting rate limits.