SparkPost
| Schemes | sparkpost:// |
| Cargo feature | service-sparkpost |
| Service | https://sparkpost.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}://{user}@{host}/{apikey}/
{schema}://{user}@{host}/{apikey}/{targets}
{schema} is one of sparkpost://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{apikey} | API Key | string | yes | secret | |
{host} | Domain | string | yes | ||
{targets} | Target Emails | list | no | separated by / | |
{user} | User Name | string | yes |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
batch | Batch Mode | bool | no | |
bcc | Blind Carbon Copy | list | separated by , or space | |
cc | Carbon Copy | list | separated by , or space | |
name | From Name | string | ||
region | Region Name | choice | us | one of us, eu |
to | Target Emails | list | sets {targets} |
Prefixed parameters:
+name=value: Email Header:name=value: Template Tokens
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):
sparkpost://user@localhost.localdomain/cccccccccccccccccccccccccccccccc
sparkpost://user@localhost.localdomain/iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii/test@example.com
sparkpost://user@localhost.localdomain/dddddddddddddddddddddddddddddddd?region=uS
sparkpost://user@localhost.localdomain/hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh?name=Jo%20Doe
sparkpost://user@localhost.localdomain/hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh/to@example.com?name=Doe,%20Jo
sparkpost://user@localhost.localdomain/cccccccccccccccccccccccccccccccc?format=markdown
sparkpost://user@localhost.localdomain/kkkk?to=test@example.com
sparkpost://user@localhost.localdomain/hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh?:name=Chris&:status=admin
Rejected URLs:
sparkpost://
sparkpost://:@/
sparkpost://user@localhost.localdomain
sparkpost://localhost.localdomain/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'sparkpost://user@localhost.localdomain/cccccccccccccccccccccccccccccccc'
Notes
SparkPost (sparkpost://): e-mail through the SparkPost API.
sparkpost://{user}@{domain}/{apikey}[/{to_email}...] ?region=us|eu&name=..&cc=..&bcc=..&batch=yes&+Header=v&:token=v
+key=value entries become e-mail headers, :key=value entries the substitution data. Without targets the message goes to the sender. HTTP 429 is retried (up to 3 attempts, 5 s apart).