Email System Setup
By the end your cluster sends its own mail, your flows send theirs through Postmark, templates can be edited without touching a blueprint, and bulk mail runs in the queue.
Step 1: Set the token and the from-address
Create the token
Create a Postmark account and a server token.
Store it
Add it as a secure system setting named
postmark_token. See Email configuration.Set the sender
Set
email_default_fromto an address on your verified sender domain, such asnoreply@yourdomain.com.Optional: SMS
Set
messagebird_originatorif you also send SMS for 2FA.
How you know it worked: platform emails such as password resets now go out. The rest is your own mail.
Step 2: Send from a flow
Pick the trigger
A form on a web page (
web_action(on web action)), a document change (storage_event(trigger event)), a schedule for digests (schedule_repeating_event(repeating event)), or another API call.Collect the data
Fetch what the mail needs: the recipient's profile, the order, the template values. Usually one
function_search(search) orfunction_get_document(get document).Open a connection
postmarkconnection_open(open connection) takes the server token, read withvalue_get_system_key_select(get setting).Send
postmarkconnection_send_email(send email) withfrom,array_to,subjectandhtmlfrom your data, orpostmarkconnection_send_email_template(send email with template) with a Postmark template and itstemplate_model. See the email template.Handle the result
Branch on the block's
conditionpin. Send failures tofunction_console_log(log) while developing, and onto a mail-log document in production.
Step 3: Keep templates out of the blueprint
- Keep subjects and bodies in storage (a
mail_templatesstorage) with keys likewelcome,reset-reminder,weekly-digest. Then you edit content without touching the blueprint. - Build the final body with
object_new_fields(new object) and text blocks, merging the template with per-mail data such as names, links and amounts.web_template(web template) also renders a template with escaping, if you prefer the template syntax from Template Syntax. - Write links as full URLs (
https://your-cluster/...): emails have no relative paths.
Step 4: Bulk and scheduled mail run in the queue
- Never loop and send inline in a request. Enqueue per-recipient jobs with
function_custom_execute_from_queue(execute in queue) and let the queue drain them. See Queue. - For a scheduled digest,
schedule_repeating_event(repeating event) gathers what changed since the last run (a range query on_meta.created) and sends one mail per user. - Record
last_sent_atper user and digest, so retries never double-send.
Deliverability is a discipline
- Verify the sender domain in Postmark before sending anything. SPF and DKIM are handled there.
- Use one clear from-address per purpose. Do not rotate from-addresses mid-thread.
- Log every send (to, template, status, error) to a storage. You will need it the first time a user says "I never got it".
- Test with a private alias first. Postmark's activity view confirms delivery before you blame the blueprint.
Next steps
System Settings Reference postmark_token, email_default_from, and secure values. Queue Bulk and scheduled sending without blocking requests. Storage Events Triggering mail on document changes. Postmark Every Postmark block, including bounces and suppressions.Frequently asked
How do I set up email sending on a RUAL cluster?
Create a Postmark server token, add it as a secure system setting named postmark_token, and set email_default_from to an address on your verified sender domain. From that point platform emails like password resets already work, and blueprints send their own mail with the Postmark send blocks.
How do I send bulk or scheduled email in RUAL?
Never loop-and-send inline in a request: enqueue per-recipient jobs with function_custom_execute_from_queue and let the queue drain them. Scheduled digests run from schedule_repeating_event, gathering what changed since the last run, and recording last_sent_at per user so retries never double-send.
How do I edit email content without changing blueprints in RUAL?
Keep subjects and bodies in a mail_templates storage with keys like welcome or weekly-digest, and build the final body by merging the template with per-mail data. Use full URLs for links, because emails have no relative paths.