render() and deliver().
1
Authenticate your domain in SendGrid
In SendGrid, authenticate the domain you will send from, so SPF and DKIM pass. See the email authentication guide.
2
Add the domain in EmailUX
Open Emails, Providers and API Keys and choose Add domain (SendGrid). Enter your domain, such as
yourdomain.com, and select Create.3
Configure the delivery provider
In the domain card, open Configure delivery provider, select SendGrid, paste your SendGrid API key, and Save. The key is stored for this domain. Choose Provider status to confirm the connection.
4
Add sender emails
Add the sender addresses you will use, for example
hello@yourdomain.com. When a provider is configured, the domain’s API key is authorized for the domain, so each sender does not need separate verification.5
Enable templates for this domain
A template is available on this domain after you enable it. On an email, choose Set SendGrid domain, or on the domain card choose Manage templates and add it. A template with no live version is not available until one is marked live.
6
Generate an API key
Select Generate API key. The domain must not be pending. See API keys.
7
Call the API
Removing a domain
Deleting a domain also removes its provider configuration, all of its API keys and all of its sender emails. You confirm by typingDelete yourdomain.com. This cannot be undone.
Troubleshooting
Generate API key is disabled
Generate API key is disabled
The domain is still pending. Finish the domain verification, then try again.
I get a 502 provider error
I get a 502 provider error
SendGrid rejected the request. Check that the saved key has mail-send permission and that the sender uses your authenticated domain.
I get a 401
I get a 401
The API key is wrong or revoked. Generate a new one.