Metadata keys per email, counted after request-level and recipient maps merge.
An order confirmation email API with your order ID on every event.
tinyRelay sends order confirmations, receipts, shipping notifications and invoice emails from your backend over a REST API or SMTP relay. Attach an order_id to each recipient and it comes back on every signed webhook event for that email.
- DELIVEREDReceiving server accepted itorder_id ✓
- CLICKurl: https://acme.com/orders/SO-1001order_id ✓
- DELIVEREDann@example.com · order_id: SO-1merged ✓
- DELIVEREDbob@example.com · order_id: SO-2merged ✓
- CLICKurl: https://acme.com/invoices/INV-20412 keys ✓
- BOUNCEDSOFT_BOUNCED · category 22 · retry laterif it fails
Example emails and metadata · illustrative
"Where is my receipt?" should take one lookup.
Every webhook event carries the metadata you sent. Store events against the order ID and support can see, for any order, whether the confirmation was sent, delivered, opened, clicked or bounced.
Per request, so one batch can carry a different order_id for each recipient.
Each event type carries your metadata back to your webhook.
Returned if a request breaks the limits, before anything sends.
Limits from the tinyRelay Send Email docs.
Order confirmation, shipping notification, invoice email.
Pick a stage to see the email, the request that sends it and the events that come back.
- SENDSent to the receiving serverorder_id ✓
- DELIVEREDReceiving server accepted itorder_id ✓
- CLICKurl: https://acme.com/orders/SO-1001order_id ✓
Order confirmation: one order, one request
Send the confirmation as soon as the order is placed. A campaignId unique to the order keeps its metadata separate from every other send.
{
"subject": "Order SO-1001 is confirmed",
"body": "<html>Hi [FIRST_NAME], thanks for your order…</html>",
"sender": { "from": { "name": "Acme Store", "email": "orders@acme.com" } },
"recipients": { "to": [
{ "email": "ann@example.com", "attributes": { "FIRST_NAME": "Ann" } }
] },
"campaignId": "order_confirmed_SO-1001",
"metadata": { "order_id": "SO-1001", "tenant_id": "acme" }
}- DELIVEREDann@example.com · order_id: SO-1merged ✓
- DELIVEREDbob@example.com · order_id: SO-2merged ✓
- OPENann@example.com · tenant_id: acme · app: checkoutmerged ✓
Shipping notification email: a batch, per-recipient IDs
When a batch of orders ships, send one request. Shared metadata goes at the top; each recipient's own order_id goes on the recipient. The maps merge and the recipient's keys win, so Ann's events carry tenant_id, app and SO-1.
{
"subject": "Your order shipped",
"body": "<html>Hi [FIRST_NAME]</html>",
"sender": { "from": { "name": "Shop", "email": "orders@shop.com" } },
"campaignId": "order_shipped_batch_17",
"metadata": { "tenant_id": "acme", "app": "checkout" },
"recipients": { "to": [
{ "email": "ann@example.com",
"attributes": { "FIRST_NAME": "Ann" },
"metadata": { "order_id": "SO-1" } },
{ "email": "bob@example.com",
"attributes": { "FIRST_NAME": "Bob" },
"metadata": { "order_id": "SO-2" } }
] }
}The docs example uses "order_shipped"; a unique campaignId per batch keeps each batch's metadata intact.
- DELIVEREDReceiving server accepted it2 keys ✓
- CLICKurl: https://acme.com/invoices/INV-20412 keys ✓
- BOUNCEDSOFT_BOUNCED · category 22 · retry laterif it fails
Invoice email: link to the hosted invoice
Send the invoice notice with both IDs as metadata, so a CLICK on "View invoice" ties back to the invoice and the order. Attachments are not covered in the current API docs, so this example links to a hosted invoice.
{
"subject": "Your invoice INV-2041",
"body": "<html>Hi [FIRST_NAME], <a href=\"https://acme.com/invoices/INV-2041\">view invoice</a></html>",
"sender": {
"from": { "name": "Acme Store", "email": "billing@acme.com" },
"replyTo": { "name": "Acme Billing", "email": "help@acme.com" }
},
"recipients": { "to": [
{ "email": "ann@example.com", "attributes": { "FIRST_NAME": "Ann" } }
] },
"campaignId": "invoice_INV-2041",
"metadata": { "invoice_id": "INV-2041", "order_id": "SO-1001" }
}Every field above is in the Send Email reference. Requests go to POST https://api.tinyemail.com/v1/relay/email/campaign with your key in X-RELAY-ACCESS-TOKEN.
Base URL from current site samples; confirm in the docs.
Metadata rules worth knowing before launch.
They are small, and each one prevents a confusing support case later.
How the email API works →- 110 keys in total, not per levelRequest-level and recipient metadata merge into one map of at most 10 keys. Keys up to 64 characters, values up to 256.
- 2Flat values onlyStrings, numbers or booleans. Numbers and booleans come back as strings. Nested objects, arrays and null are not supported.
- 3Keys are normalisedKeys become lowercase snake_case: OrderID comes back as order_id. Two keys that normalise to the same name are rejected.
- 4Attributes are not metadataAttributes fill merge tags such as [FIRST_NAME] and are never echoed. Metadata never appears in the email and is always echoed.
- 5One campaignId per batchReusing a campaignId replaces the earlier metadata, including per-recipient entries. Use a unique one, or omit it and the requestId is used.
Already sending from a store platform? Use SMTP.
If your store platform or framework lets you set an external SMTP server, point it at the tinyRelay SMTP relay with the credentials issued at onboarding. No code changes to your templates.
The per-recipient metadata shown above is documented for the REST API. Ask our team how SMTP sends map to webhook events for your setup.
SMTP settings
Entered once in your platform's email settings.
Host, port and TLS settings to be confirmed before launch.
Yes. One request can carry many recipients, each with their own attributes and their own metadata, such as a different order_id. At most 500 recipients in one request may carry their own metadata.
Up to 10 keys in total after request-level and recipient metadata are merged. Keys can be up to 64 characters and values up to 256 characters. A request that breaks the limits is rejected with 412 before any email is sent.
If your store platform or framework lets you set an external SMTP server, you can point it at tinyRelay with the SMTP credentials issued at onboarding. The metadata fields on this page are documented for the REST API.
Attachments are not covered in the current tinyRelay API docs. The invoice example on this page links to a hosted invoice instead. Ask our team if you need attachments.
Metadata is scoped to the campaignId. If two requests share one, the later request's metadata replaces the earlier one, including every per-recipient entry. A unique campaignId per batch, or none at all, keeps them apart.
Send transactional email with a service that reports back.
SMTP relay or REST API, standalone or alongside tinyEmail. Tell us what you send and our team sets you up.