Skip to main content

SendGrid integration

This guide walks you through connecting SendGrid to Better Email and exporting finished emails as SendGrid Dynamic Templates.

Before you start

To connect SendGrid, you will need:

  • a SendGrid account with access to create API keys
  • an API key that can create and update Dynamic Templates
  • the correct SendGrid region for the account (Global or EU)
  • optional: the on-behalf-of value if a parent account exports for a subuser
  • an admin user in Better Email who can create and edit integrations

1. Create an API key in SendGrid

In SendGrid:

  1. Go to Settings -> API Keys.
  2. Create a new API key for Better Email.
  3. Give the key permissions that allow creating templates and template versions.
  4. Copy the API key right away.

SendGrid only shows the full API key once. If you lose it, create a new key and update the Better Email integration.

2. Confirm the SendGrid account settings

Before adding the key to Better Email, confirm which SendGrid account the key belongs to.

Important to know:

  • Leave Region blank, or use Global, for standard SendGrid accounts.
  • Use EU for SendGrid EU regional subusers.
  • Only fill in On-behalf-of account if your SendGrid setup requires the on-behalf-of header for a parent account to export for a subuser.

If you are not sure whether the account is global or EU, check the SendGrid account setup before enabling the integration. Using the wrong region sends requests to the wrong SendGrid API host.

3. Set up the integration in Better Email

In Better Email:

  1. Go to Integrations.
  2. Create a new integration.
  3. Enter a clear name for the integration.
  4. Choose SendGrid as the type.
  5. Optional: under Access, restrict the integration to specific users or groups.
  6. Save the integration.
  7. Enter the API Key.
  8. Optional: set Region to EU for EU regional subusers. Leave it blank for global SendGrid accounts.
  9. Optional: enter On-behalf-of account if your SendGrid parent/subuser setup requires it.
  10. Optional: enter Default subject and Default preheader.
  11. Enable the integration.
  12. Save the integration again.

The integration is now ready to export Dynamic Templates to SendGrid.

4. Define subject lines and preheaders

SendGrid exports use Better Email's native subject and preheader fields.

When you export:

  1. Better Email uses the email's subject as the SendGrid version subject.
  2. Better Email adds the preheader as hidden preview text at the start of the exported HTML.
  3. If the email does not provide a subject, Better Email uses the integration's Default subject.
  4. If there is no email subject or default subject, Better Email uses the email name as the subject.
  5. If the email does not provide a preheader, Better Email uses the integration's Default preheader.

This keeps the subject line and inbox preview text managed in Better Email while still exporting them into SendGrid's Dynamic Template version.

5. Export to SendGrid

Once the integration is active, users can export from the Better Email export dialog.

On the first export, Better Email:

  • creates a SendGrid Dynamic Template using the Better Email email name
  • creates an active template version with the rendered HTML
  • sends the subject line with the version
  • inserts the preheader as hidden preview text in the HTML
  • asks SendGrid to generate plain-text content automatically
  • stores the SendGrid template ID and version ID on the email

On later exports of the same email, Better Email reuses the stored template ID and creates a new active version on the existing SendGrid template instead of creating a duplicate template.

Current limitations

The SendGrid integration is focused on exporting Dynamic Templates.

It does not currently:

  • sync recipient fields from SendGrid
  • provide SendGrid-specific segmentation rules
  • create campaigns, automations, sends, or schedules in SendGrid

Use SendGrid after export to connect the Dynamic Template to the transactional or marketing workflow that should send it.

Troubleshooting

SymptomFix
Export fails with an authorization errorCheck that the API key is correct, still active, and has permission to create templates and template versions
Export goes to the wrong SendGrid accountConfirm that the API key belongs to the right account or subuser, and check the On-behalf-of account value
EU account export failsSet Region to EU in the Better Email integration
Re-export creates a new template instead of updating the existing oneConfirm the email was exported from the same Better Email email and integration so the stored SendGrid template ID can be reused
Subject or preheader is not what you expectedCheck the email's native subject/preheader fields first, then the integration's Default subject and Default preheader values