by Customer.io
Send a transactional email
Sends one transactional email to a person, from a template filled with your message data or from a subject, body and sender you pass, creating the person if needed.
Description
Pass `to`, the person's `identifiers` (one of `id`, `email` or `cio_id`) and a `transactional_message_id`, the template's ID or trigger name, so metrics roll up per message; `message_data` fills the template's Liquid. The CLI sends with a service-account token and needs `--environment-id`, the workspace ID; production code should send with an App API key.
send-transactional-email.md
Send a transactional email
Sends one transactional email to a person, from a template filled with your message data or from a subject, body and sender you pass, creating the person if needed.
Pass to, the person's identifiers (one of id, email or cio_id) and a
transactional_message_id, the template's ID or trigger name, so metrics roll
up per message; message_data fills the template's Liquid. The CLI sends with
a service-account token and needs --environment-id, the workspace ID;
production code should send with an App API key.
Set up
Use the first option your agent supports.
CLI (official)
Install the command, then confirm it runs.
npm install -g @customerio/cli
cio --version
Run cio send email.
Set $CIO_TOKEN in your environment first (get a key: https://fly.customer.io/settings/api_credentials?keyType=service_accounts).
API (official)
- Base URL: https://api.customer.io
- Endpoint:
POST /v1/send/email - Auth: send the header
Authorization: Bearer $CUSTOMERIO_API_KEY - Get a key: https://fly.customer.io/settings/api_credentials?keyType=app
- Docs: https://docs.customer.io/integrations/api/app/
Before doing anything else, make one read-only call to confirm access.
Rules
- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
Built from these files in the repository
The layout and the rules come from lib/catalog/render-markdown.ts, the set-up wording from lib/catalog/render-access.ts.