Email

Create an email automation

When something happens, send a template (or start a sequence) to the person it happened to, or to a fixed address that appears in the project. Events: form.submitted (a form on one of the project's sites was sent; filter.collection for one form), booking.created (a form submission in the collection bookings, or the one in filter.collection), order.paid, order.payment_failed (the payment failed, expired or was canceled), app_user.created (someone became a user of an app; filter.app_id for one app), and for subscriptions on paid access subscription.payment_failed, subscription.past_due, subscription.chargeback, subscription.canceled, subscription.paused, subscription.resumed and subscription.recovered (to: contact is the buyer). The variables are the fields of the form, or order_id, order_number, total and currency, or for a subscription subscription_id, product, amount, currency, interval, status, paid_until, reason, pay_url (the buyer's signed link to pay or cancel), manage_url (the same link), order_id where it applies, plus email and name, plus email and name. delay_minutes waits, like 60 for an hour (at most 30 days). Every event sends at most once per automation, also when it is reported twice. The email follows all rules of POST /emails: category transactional (default) answers what the person did. A test project only simulates.

post/email-automations

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/email-automations
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: messages:write)

Request body

event'form.submitted' | 'booking.created' | 'order.paid' | 'order.payment_failed' | 'app_user.created' | 'list.subscribed' | 'subscription.payment_failed' | 'subscription.past_due' | 'subscription.chargeback' | 'subscription.canceled' | 'subscription.paused' | 'subscription.resumed' | 'subscription.recovered' required

What happens.

template_idstring uuid

The template to send. Give template_id or sequence_id.

sequence_idstring uuid

Or: start this sequence for the person.

tostring

contact (default): the person of the event (who sent the form, the buyer, the new app user). Or one fixed address that appears in the project, like the owner's, for a notice.

fromstring required

The sender: an address on a verified sending domain of this project, optionally with a name, like "Acme hello@acme.com".

reply_tostring

Optional. Where replies go, like the owner's own mailbox.

category'transactional' | 'other'

transactional (default): it answers what the person did. other: gets an unsubscribe link.

delay_minutesinteger

Wait this long after the event, like 60 for one hour. 0 sends right away.

enabledboolean

Response

The automation.

idstring uuid required
event'form.submitted' | 'booking.created' | 'order.paid' | 'order.payment_failed' | 'app_user.created' | 'list.subscribed' | 'subscription.payment_failed' | 'subscription.past_due' | 'subscription.chargeback' | 'subscription.canceled' | 'subscription.paused' | 'subscription.resumed' | 'subscription.recovered' required
template_idstring uuid nullable required
sequence_idstring uuid nullable required
tostring required

contact (the person of the event) or a fixed address.

fromstring required
reply_tostring nullable required
category'transactional' | 'other' required
delay_minutesinteger required
enabledboolean required
created_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.