The Mailer API sends a mass email from the workspace to users — the programmatic counterpart of the admin Mailer tool used for announcements — and handles the unsubscribe links those emails contain.
Common workflows
Send an announcement to workspace users
Send the mailer email with a from address, subject, body, and a query selecting the recipient users.
Include the unsubscribe placeholder in the body; recipients who opt out are recorded through the mailer unsubscribe endpoint and skipped in future sends.
Conventions
Sending requires the
send-mailadmin permission, and the workspace's SMTP settings must be configured for any email to go out.The recipient
queryis a MongoDB-style selector over user documents, sent as a JSON string.For the admin UI equivalent, see the Mailer user guide.