FlowPrime guides

Mail: send your product's transactional e-mail

Mail sends the e-mail your product sends one person at a time: receipts, notifications, "your export is ready", magic links of your own. It also carries what newsletter and marketing send, and your customers' account mail (verification, password reset, invitations). Every message goes out through mail providers your workspace registers (Resend, SendGrid, Amazon SES, Postmark, Mailgun, SMTP2GO, Brevo), from sender addresses those providers own.

On this MCP server you can see whether the workspace's mail is delivered (mail_status, mail_domain_status), set it up yourself (connect a provider, switch delivery mode, create a server token, manage templates; org admins only) and prove it with mail_send_test, which sends a test to the signed-in person's own address. Your product sends over the REST API with a server token. This guide says exactly which part is which.

What you can do

Capability How Status
See whether the workspace's mail is delivered (servers, modes, providers, verdict) mail_status live
Connect a provider (key checked by the provider before it is saved) and attach it to a server mail_connect_provider, mail_update_provider, mail_remove_provider, mail_list_providers, or dashboard (Email > Overview, Send test to me on the server's line) live
Check the sending domain (DKIM, SPF, DMARC) mail_domain_status, or dashboard (Email > Settings, the server's Sending domain row) live
Prove mail reaches an inbox mail_send_test, or dashboard (Email > Overview, Send test to me on the server's line) live
Switch a server between sandbox and live (needs the person's yes: confirm=true) mail_set_delivery_mode, or dashboard (Email > Settings, the server's Mode row) live
Create, list and revoke server tokens for your product mail_create_server_token, mail_list_server_tokens, mail_revoke_server_token, or dashboard (Email > Settings, the server's API keys row) live
Create, edit, preview and delete templates mail_save_template, mail_preview_template, mail_list_templates, mail_get_template, mail_delete_template, or dashboard (Email > Settings, the server's Templates row) live
Send one message REST POST /v1/email/send with X-Server-Token live
Send up to 50 messages in one call REST POST /v1/email/batch with X-Server-Token live
Send from a template, optionally replacing its subject REST POST /v1/email/send-template with X-Server-Token live
Read a message's status and events, list by tag or status REST GET /v1/messages/{id}, GET /v1/messages?tag=&status= with X-Server-Token live
Read templates REST GET /v1/templates, GET /v1/templates/{alias} with X-Server-Token live
Delivery stats, do-not-send list, provider distribution and caps dashboard (Email > Overview: each day's sends by outcome and the bounce and complaint gauges; Email > Settings, the server's Deliverability and Distribution rows) dashboard
Everything one person received mail_list_messages with to, or dashboard (Customers, the customer's page) live
Read messages and their delivery events mail_list_messages, mail_get_message (org admins: recipients are customer e-mails) live
Send your product's mail from an MCP tool none, by design: your product sends over REST with its server token -

Before you start

Read this before writing any code: a workspace's mail does nothing until it has a provider. Call mail_status first: verdict delivering means mail goes out and the latest send was handed to the provider; sends_failing means a provider is set but the latest sends failed, and lastFailure names the provider's answer; live_without_provider (the starting state) means every message is recorded and NOT sent. Each server also carries checks: provider, sender, domain and test, the same four steps the dashboard shows under Mail > Is mail working?, each ok, todo, failing, waiting or unknown with what to do next.

  1. Every workspace has a "Default Server" in live mode with NO provider. Until a provider is registered, every send your product makes is accepted, stored and then fails with a named reason ("no sending provider" or "no provider for the From address").
  2. Your customers' verification, password-reset, invitation and set-your-password mail rides the same providers. With none registered, your customers receive none of it, and there is no platform fallback for it: it goes out under your name, so it needs your provider. Your own team's admin mail is the exception: FlowPrime always delivers it.
  3. Connect a provider with mail_connect_provider (org admins), or ask the person to open the dashboard, Mail:
  4. While building, a server in sandbox mode records every message as delivered and sends nothing. Switch to live before launch.

Hosts: https://{org}.mail.fastflow.tech in production, https://{org}.mail.fastflowtech.ai on staging. {org} is your workspace slug (auth_get_org).

Step by step

Send one message from your backend

curl -s https://{org}.mail.fastflow.tech/v1/email/send \
  -H "X-Server-Token: <server token>" -H "Content-Type: application/json" \
  -d '{"from":"Example <[email protected]>","to":"[email protected]",
       "subject":"Your export is ready","htmlBody":"<p>Download it here.</p>",
       "textBody":"Download it here.","tag":"export-ready"}'
  1. from, to and subject are required (422 otherwise). from must be an address one of your providers lists.
  2. Optional: cc, tag (group messages for stats and lookups), headers (custom headers), stream (transactional, the default, or broadcast), track: true (count opens and clicks).
  3. The answer is 200 with the message id and its status. A 200 does NOT mean delivered: read GET /v1/messages/{id} and its events (sent, delivered, bounced, failed with the reason).

Send from a template

  1. In the dashboard, create a template with an alias, e.g. receipt, a subject and an HTML body with {{name}}, {{total}}.
  2. Call:
    POST /v1/email/send-template
    {"from":"Example <[email protected]>","to":"[email protected]",
     "templateAlias":"receipt","templateModel":{"name":"Ana","total":"R$ 49,00"},"tag":"receipt"}
    
  3. Optional subject replaces the template's subject and is filled from templateModel the same way; leave it out (or empty) to keep the template's.
  4. An unknown alias answers 404 Template 'receipt' not found for that server.

Send several at once

POST /v1/email/batch with {"messages":[{...},{...}]}, each item shaped like a single send (up to 50). The answer is one result per message, in order. Use it for a handful of related notifications, not for a mailing list.

Find out what happened to a message

  1. GET /v1/messages/{id} with the server token answers the message, its status and its events, each with a detail line (the provider's answer, or why it failed).
  2. GET /v1/messages?tag=export-ready&status=failed&page=1&pageSize=50 lists messages of the token's server by tag and status.
  3. Statuses: queued, sent, retry (a transient provider error, retried by itself), delivered, failed, and suppressed (the address is on the do-not-send list, nothing was sent). Bounces arrive later as events on the message; a configuration error (no provider, From not owned) keeps failing until the setup is fixed.

Prove the setup before launch

  1. mail_status answers delivering for the server that carries account mail with every check ok, and mail_send_test answers delivered (handed over is not received: only delivered proves the inbox).
  2. Server in sandbox: send to your own address, then GET /v1/messages/{id} shows delivered with "Sandbox delivery".
  3. Switch to live, send again to a real mailbox you control, and open it.
  4. Trigger a password reset on your product with a test account (see platform_guide topic=auth) and confirm the mail arrives: that proves your customers' account mail works too.

Things that trip agents up

Reference

Where to go next