Skip to main content

SendGrid

1. Create an API key​

  1. Sign in to SendGrid and open Settings → API Keys → Create API Key.
  2. Choose Restricted Access and give Mail Send full access. Add Template Engine → Read Access if you want to use List dynamic templates.
  3. Click Create & View and copy the key (it starts with SG.). SendGrid shows it only once.

Before you can send, verify who mail comes from: either a single address (Settings → Sender Authentication → Verify a Single Sender) or your whole domain (Authenticate Your Domain).

2. Create the connection​

  1. In Blokkio, go to Apps and open SendGrid.
  2. Click Connect, paste the key into API key (or click Use secret) and click Create.
  3. Test connection calls GET /v3/scopes and shows Connected — api.sendgrid.com answered 200.

Actions​

Send email​

InputDescription
ToOne or more addresses, separated by commas
Cc, BccMore recipients
From emailA verified sender or an address on your authenticated domain
From name, Reply-to emailOptional
SubjectRequired unless your template sets it
Plain text, HTMLThe content; fill one or both
Dynamic template IDd-…: send a dynamic template instead of text/HTML
Template dataJSON for the template's {{handlebars}}, for example { "name": "Ada", "order": 1042 }
AttachmentsFiles from other blocks, for example {{ $nodes.Report.output.file }} (up to 25 MB in total)
CategoriesUp to 10 labels for your statistics
Send atUnix time to schedule up to 72 hours ahead

SendGrid answers 202 Accepted with an empty body: the email is queued. Delivery problems (bounces, blocks) show up in SendGrid's Activity Feed.

List dynamic templates​

Lists your dynamic templates with their id and name, so you can pick the Dynamic template ID.

Troubleshooting​

MessageWhat to do
HTTP 401The key is wrong or was deleted.
HTTP 403 … The from address does not match a verified Sender IdentityVerify the sender or domain, or use an address on your authenticated domain.
HTTP 403 … access forbiddenThe key lacks Mail Send (or Template Engine for listing templates).
HTTP 400 … The content value must be a string at least one character in lengthFill Plain text or HTML, or use a template.