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

  1. Create the token

    Create a Postmark account and a server token.

  2. Store it

    Add it as a secure system setting named postmark_token. See Email configuration.

  3. Set the sender

    Set email_default_from to an address on your verified sender domain, such as noreply@yourdomain.com.

  4. Optional: SMS

    Set messagebird_originator if 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

  1. 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.

  2. Collect the data

    Fetch what the mail needs: the recipient's profile, the order, the template values. Usually one function_search (search) or function_get_document (get document).

  3. Open a connection

    postmarkconnection_open (open connection) takes the server token, read with value_get_system_key_select (get setting).

  4. Send

    postmarkconnection_send_email (send email) with from, array_to, subject and html from your data, or postmarkconnection_send_email_template (send email with template) with a Postmark template and its template_model. See the email template.

  5. Handle the result

    Branch on the block's condition pin. Send failures to function_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_templates storage) with keys like welcome, 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_at per 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.