SendGrid
| Schemes | sendgrid:// |
| Cargo feature | service-sendgrid |
| Service | https://sendgrid.com |
| Body formats | html (first is the default) |
| Attachments | yes |
| Title length | 250 characters |
| Body length | 32,768 characters |
| Body lines | unlimited |
| Request throttle | 200 ms between requests |
| Vendor URLs accepted | no |
URL formats
{schema}://{apikey}:{from_email}
{schema}://{apikey}:{from_email}/{targets}
{schema} is one of sendgrid://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{apikey} | API Key | string | yes | secret; must match ^[A-Z0-9._-]+$ | |
{from_email} | Source Email | yes | |||
{target_email} | Target Email | no | |||
{targets} | Targets | list | no | any of target_email; separated by / |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
bcc | Blind Carbon Copy | list | separated by , or space | |
cc | Carbon Copy | list | separated by , or space | |
template | Template | string | ||
to | Targets | list | sets {targets} |
Prefixed parameters:
+name=value: Template Data
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
sendgrid://abcd:user@example.com
sendgrid://abcd:user@example.com/newuser@example.com
sendgrid://abcd:user@example.com/newuser@example.com?+sub=value
sendgrid://abcd:user@example.com/newuser@example.com?format=text
sendgrid://abcd:user@example.com/newuser@example.com?cc=l2g@nuxref.com
sendgrid://abcd:user@example.com/newuser@example.com?to=l2g@nuxref.com
sendgrid://abcd:user@example.com/newuser@example.com?bcc=l2g@nuxref.com
sendgrid://abcd:user@example.com/newuser@example.com?cc=l2g@nuxref.com&bcc=l2g@nuxref.com
Rejected URLs:
sendgrid://
sendgrid://:@/
sendgrid://abcd
sendgrid://abcd@host
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'sendgrid://abcd:user@example.com'
Notes
SendGrid (sendgrid://): e-mail through the SendGrid API.
sendgrid://{apikey}:{from_email}[/{to_email}...][?cc=..&bcc=..&template=..&+key=value]
+key=value entries become the dynamic template data. Without targets the message goes to the sender.