Skip to main content
Modelence sends transactional emails — verification, password reset, and any custom emails you trigger via sendEmail — through a built-in managed email provider. No provider setup, no API keys, no SMTP credentials. Apps connected to Modelence Cloud get email working immediately. If you outgrow the managed provider or need custom domains, attachments, or full deliverability control, you can swap in a custom provider (Resend, Amazon SES, or SMTP) at any time.

Built-in Managed Email (Default)

Built-in managed email requires modelence v0.18.0 or newer. Earlier versions still require you to configure a provider explicitly. Update with npm install modelence@latest.
When your app is connected to Modelence Cloud, the managed email provider is enabled automatically. You don’t need to install any package, configure credentials, or pass a provider to startApp.

Minimum setup

That’s it. Verification and password reset emails go out automatically. You can also call sendEmail for custom transactional messages (see Sending Custom Emails).

How it works

  • Outbound mail is relayed through Modelence Cloud (/api/email/send), which sends via Resend on a Modelence-owned domain.
  • You can still pass from: '"Your App" <noreply@anything>' to set a friendly name; the address part is replaced by the managed sender. The replyTo field works normally so users can still reply to your support inbox.
  • Local development (no Modelence Cloud connection) falls back to the legacy “no provider configured” behavior so misconfigurations fail loudly during development.

Limitations in v1

The managed provider focuses on the common transactional case. It does not support:
  • cc / bcc recipients
  • File attachments
  • Custom email headers
  • Custom sender domains
If you call sendEmail with any of these, Modelence throws a clear error. Use a custom provider when you need them.

Custom Email Templates

You can customize the HTML for verification and password reset emails. Templates work the same whether you use the built-in provider or a custom one:

Sending Custom Emails

Use sendEmail to send arbitrary transactional emails — order confirmations, invites, notifications, anything you trigger from your own code. It routes through whichever provider is active (managed or custom), so the call site stays the same.

Basic example

Calling sendEmail from a mutation

A typical use case — sending a notification when a user completes an action:

Plain-text and multipart emails

Provide text for clients that don’t render HTML, or both html and text for a multipart message:

Sending to multiple recipients

Email Payload Options

You must provide either html or text (or both). Fields marked custom provider only are rejected by the built-in managed provider — see Custom Email Providers if you need them.

Troubleshooting

Error: “Modelence managed email does not support cc, bcc, attachments, or custom headers”

The built-in managed provider does not support these fields in v1. Either remove them from your sendEmail call, or configure a custom provider (Resend, SES, or SMTP).

Error: “Email provider is not configured”

You’re running locally without a Modelence Cloud connection and haven’t set a provider. Either:
  • Connect your app to Modelence Cloud to use the managed provider, or
  • Configure a custom provider.

Next Steps