Skip to main content
Use the Meridian SDK or public API to send an active email template to one or more recipients. Every send consumes your app’s monthly email allowance and is tracked in Sends and deliverability.
The SDK methods on this page require @the-meridian/sdk 1.19.0 or later. The HTTP endpoint works from any version.
The simplest, safest path for merchant-facing mail:
Under the hood this mints a shop token, calls sendEmail with shop context (for optional merchant metering), and logs actionable errors without breaking your app. Like every shop-token send, it only reaches the store’s own email address and its known contacts. See Who a shop-token send can reach.

Shop context vs app context

Shop-token sends never fire usage_event.tracked automations, so a transactional email cannot accidentally re-enter your automation graph. variables fills the template’s {{tokens}}. On a shop-token send, Meridian also fills these itself, from what it knows about that store, the way an automation email reads them:
  • app_url, which links to your app in that store’s admin.
  • The store’s variables: store_name, store_domain, store_primary_domain, store_status, store_currency, store_country, store_language, store_shopify_plan, store_is_shopify_plus, store_installed_at, store_active_days, store_total_revenue, store_monthly_revenue, store_total_charges, store_last_charge_amount, store_last_payment_at and store_is_test.
These are defaults: a key you pass in variables always wins, even with an empty value, app_url included. A value Meridian does not have yet for the store reads empty, as in an automation. See From the install report, or from Shopify Partner data. An API-key send has no store, so app_url is empty there and no store variable is filled. Any other token, such as plan_name or a contact variable, comes from variables only. The email editor flags a token your app passes, such as {{count}}, as “Not a Meridian variable”, and Meridian still fills it from variables at send time. Meridian substitutes variables exactly as you pass them, so a date prints the way your code formats it: "2026-10-26" stays 2026-10-26. The dates Meridian fills itself (store_installed_at and store_last_payment_at) print the way automation emails print date variables: “October 26, 2026”.

Who a shop-token send can reach

A shop token stands for one store, so its sends only reach that store. Every address in to must be either:
  • the store’s own email address, or
  • one of the store’s known contacts.
A store’s contacts come from:
  • the contacts your app sends through identify from its backend,
  • staff captured automatically when they use your app,
  • contacts added by hand on the store’s page in the CRM.
Matching ignores case and surrounding spaces. If any recipient is not one of the store’s addresses, Meridian refuses the whole request with a 422 (VALIDATION_ERROR) on to, before any email is sent or counted. A store with no email and no contact can’t receive a shop-token send. The error doesn’t list the store’s addresses. To reach anyone else, send with an API key from your app’s backend. That send has no store context: no merchant billing, no app_url and no store variables.

How this differs from automations

Automations and SDK sends share the same SendGrid pipeline, quota enforcement, and deliverability tracking. They do not double-charge or conflict.

Setup

  1. Create and activate an email template in the Meridian dashboard.
  2. Copy the email’s ID. Open the email in Emails: the Email ID row at the bottom of the Inbox settings card shows it, with a Copy button. Pass it as emailId.
  3. Call sendEmail from your app backend. Never put your API key in the browser.

Examples

Shop context (merchant billing)

App context (platform quota only)

Reliability

  • Idempotency: Pass idempotencyKey on sends you may retry (webhook handlers, job queues). Retries with the same key, template, and recipient return the original send row instead of dispatching again. Reusing a key for a different template returns IDEMPOTENCY_KEY_CONFLICT.
  • All-or-nothing per request: If any recipient in a batch fails at SendGrid, the API returns an error. Quota for failed units is released automatically.
  • Rate limit: 60 requests/minute per app.

Limits and errors

  • Up to 20 recipients per request.
  • A shop-token send only reaches the store’s own email address and its known contacts. Any other recipient is refused (422). See Who a shop-token send can reach.
  • Inactive templates are rejected (422).
  • Over-quota sends return USAGE_LIMIT_EXCEEDED (409).
  • An app with no verified sending domain still sends. The message leaves from no-reply@mail.the-meridian.app and includes a note that it was sent by a Meridian user’s app, not by the Meridian platform. The app sends from the domain it selected in App settings → Email, or from the organization’s default when it selected none, and those sends do not include the note.
  • One exception: an app whose name contains “Meridian” needs a verified sending domain for live sends. Without one, the request returns EMAIL_SENDING_DOMAIN_REQUIRED (409), and nothing is sent or counted against your quota.
  • While Meridian’s sending capacity is exhausted, sends return SENDGRID_CAPACITY_EXHAUSTED (503) and nothing is sent or counted against your quota. Retry later. An automation’s Send Email step fails during the pause with the reason “Email send paused”.
See Emails for template authoring and Automations for lifecycle sends.
Last modified on November 16, 2026