Skip to main content
Prerequisites: a permanent inbox you provisioned in Settings > Email inboxes, or an ephemeral inbox you create at runtime with email.create.
Email runs inside the JavaScript step’s sandbox via the global email object. Momentic-provisioned inboxes end in @usemomentic.com or @gomomentic.com.

email.create

Provision an ephemeral inbox at test runtime. Momentic deletes it after 24 hours. The lifetime is fixed and not configurable from test code. Use this when each run needs a clean inbox (signup flows, magic-link logins, password resets) and you don’t want to share a permanent address across parallel runs.
Then drive your app’s signup flow with UI steps using {{ env.INBOX_EMAIL }}, and in a later JavaScript step fetch the verification email:
Ephemeral inboxes do not count toward the self-serve plan’s permanent-inbox cap.

email.send

Send an email from a Momentic-provisioned address.
You can send to Momentic-provisioned addresses and receive email in Momentic-provisioned inboxes without contacting Momentic. For outbound email to an address outside Momentic, use a Momentic-provisioned inbox for from and contact Momentic to allowlist the recipient address or domain for your organization.

email.fetchLatest

email.fetchLatest returns the most recent email, polling until one arrives or the timeout elapses. It throws on timeout.

email.fetchAll

email.fetchAll returns up to limit emails without polling and throws if the inbox is empty. Defaults: 15-minute window, 3 emails. Max: 24 hours, 10 emails.

Isolated inboxes

Append a suffix to your provisioned username to create unlimited isolated inboxes. If your username is momentic, momentic+test@usemomentic.com is a separate inbox fetched via inbox: "momentic+test". Use randomized suffixes (e.g. Date.now()) in parallel runs to avoid race conditions.
The JavaScript step defaults to a 90-second timeout. On Momentic cloud, this is capped at 60 seconds by the platform; on the CLI, it can be configured up to 10 minutes. If your email.fetchLatest timeout exceeds the JavaScript step’s timeout, set the JavaScript step’s Timeout field high enough to cover the whole script or the step will be killed before your code returns.