Sending emails

Overview

  • Applications can send emails to the website owner.
  • You can not send emails to any other address (yet).
  • Attachments are not supported (yet).

See the sjs-4 outbox for a concrete API.

Architecture

Boomla was built with simplicity and testability in mind. Email sending fits nicely into this architecture.

Technicaly, you can not directly send emails, instead, you add emails to an outbox. Emails in this outbox are then sent after serving the response to the visitor.

More specifically, applications run in transactions and an individual outbox is created for each such transaction. When running other apps in child transactions, those transactions receive their own outboxes. When such a child transaction successeeds, its outbox is flushed onto its parent, or it is dropped entirely should it fail. This helps maintaining the guarantee that no transaction will succeed partially.

This also means that applications control the side-effects of their child transactions. This greatly simplifies testing. You can assert that the expected emails are in the outbox, and then prevent sending them.

Limits

  • Send up to 1000 emails in any rolling 24 hour period to a single Boomla account. Emails are counted on a per account basis, not a per website basis.
  • The email body is limited to 5MB (5242880 bytes).