> ## Documentation Index
> Fetch the complete documentation index at: https://notikaai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Database-triggered email

> A database-triggered email starts when app data changes, such as a new user row, payment row, invite row, or status update.

A database-triggered email is an email workflow that starts when app data changes.

For example:

* a user row is created
* a payment row is inserted
* an invite changes from drafted to sent
* an order status becomes shipped
* a support ticket is marked resolved

## Why use a database trigger?

The database is often the most reliable source of truth for product state. If the row exists, changed, or reached a specific value, the workflow can react to that state directly.

This reduces the need to add email API calls throughout your app code.

## How it differs from an API-triggered email

An API-triggered email starts because your app code called an email service.

A database-triggered email starts because the data changed.

| Type                     | Starts from    | Best for                       |
| ------------------------ | -------------- | ------------------------------ |
| API-triggered email      | app code       | simple sends at a known moment |
| Database-triggered email | database event | workflows tied to app state    |

## Example workflow

```mermaid theme={null}
flowchart LR
  row["New signup row"] --> welcome["Send welcome email"]
  welcome --> wait["Wait 3 days"]
  wait --> query["Check activation state"]
  query --> reminder["Send reminder if still inactive"]
```

## Related terms

* [Database-driven email](/docs/learn/database-driven-email)
* [Supabase email](/docs/learn/supabase-email)
* [Email Workflow Planner](/docs/learn/tools/email-workflow-planner)
