Skip to main content

Overview

If you run a SaaS on top of Minimo (one workspace, your customers as tenants, see How embedded Minimo works), your backend does not need a scheduler. It sends Minimo an event when something happens (booking.created, booking.updated, booking.cancelled); Minimo keeps the rules and the clock:
  • a rule says which email goes out for which event, immediately or at an offset from a date in the event (“2 hours before booking_at”);
  • a booking.cancelled with the same cancellationKey cancels what is still pending, booking.updated moves it;
  • each tenant can switch a rule off from the automatic messages widget (or you do it by API);
  • the email is the tenant’s own version of the template when they personalized it.
No cron, no queue, no deduplication on your side.

Before you start

  • An API key with the Events permission (events) to send events, and Widgets (widgets) to manage the rules. Keep it on your server.
  • The email templates (masters) your tenants use, e.g. confirmation, reminder, review request.

1. Define the rules once (for every tenant)

PUT adds or updates the rules you send (by key) and returns every rule with a readable timing (“Immediately”, “2 hours before”); GET /public/v1/automation-rules lists them, DELETE /public/v1/automation-rules/{key} removes one (204). A rule with an offset and no dateField is refused (422 INVALID_AUTOMATION_RULE).

2. Send events (your backend)

When the booking changes or is cancelled, send the same cancellationKey:
The response (202) tells you what was planned:
status / automations are about workspace automations with an “Event received” trigger, which keep working as before on the same events.

What happens at send time

Nothing decided when the event arrived is trusted when the email is due. Minimo checks again that the rule still exists and is on for the tenant, that the guest still exists and did not hard-bounce, that the template is there, that the sender is still allowed and, for a marketing template such as the review request, that the guest has marketing consent and the workspace is not on a marketing hold. The unsubscribe footer and List-Unsubscribe header apply as for every send. A send that does not go out is never an error to you: it is recorded with a reason.

Per tenant: switch off or change a rule

The automatic messages widget shows each tenant an Automatic sends list with an on/off switch per rule. The choice is saved by Minimo for that tenant and your page receives automation.toggled with { tenant, rule, enabled }. A send of a rule that is off is recorded as skipped / disabled_by_tenant. By API (any field of a default can be overridden for one tenant, using the default’s key; a key without a default is the tenant’s own rule and needs event, template and the timing, with "offset": null for an immediate one, otherwise 422 INVALID_AUTOMATION_RULE):
GET /public/v1/tenants/{tenant}/automations returns the tenant’s effective rules (source: default, override or tenant); DELETE /public/v1/tenants/{tenant}/automations/{key} goes back to the default (204, 404 when the tenant has no override for that key).

Or schedule one email yourself: sendAt

If your backend already knows when an email must go out, you can skip the rules and schedule a single send. Add sendAt to POST /public/v1/transactionals or POST /public/v1/templates/email/send (scope transactional):
The answer is HTTP 201 with status: 202 inside (scheduled, not sent):
  • transactional: the template uid (7 characters). Send the master: the tenant’s copy is picked when the email goes out.
  • sendAt: ISO 8601 with its UTC offset, in the future, at most 90 days ahead (422 INVALID_SEND_AT otherwise, with a userMessage that says what is wrong). Without sendAt nothing changes: the email goes now and the response is the usual one.
  • Checked now: the template exists, tenant, replyTo, the sender (from/senderId under a verified domain). Checked again when it goes out, like any send: the tenant’s version of the template (picked at that moment), the sender, bounces, marketing consent (marketing templates only: a utility email is never blocked by consent) and the tenant’s sending limits.
  • idempotencyKey: the same key again returns the send already scheduled (duplicate: true), nothing new is planned. On /templates/email/send it is a UUID.
  • Goes out once, at most a minute late; more than 5 minutes late (e.g. an outage) it is skipped, never sent late.
  • Never for sign-in, verification or system emails and never with a one-time code or sign-in link in the fields (422 SEND_AT_NOT_ALLOWED). On /templates/email/send it schedules the template content: no html, subject, text or attachments.
Send the DELETE calls without a body and without a Content-Type: application/json header (an empty JSON body is refused with 400). These sends are separate from the rules: a booking.cancelled event does not cancel them and /public/v1/scheduled-sends does not list them.

Limits

  • Email only; one event → one email per rule. No multi-step flows, waits or conditions (use the workspace automations for those).
  • Changing a rule’s offset does not move sends already planned: send the update event.
  • Offsets up to one year.