
# Email & Notification Actions

The `email` family sends transactional email from a running automation. The `analytics` family emits named events used for notifications, metrics, and downstream tracking.

## Email — Send

One operator. Recipients support templates; `cc`/`bcc`/`replyTo` accept a single address or an array.

| Prop      | Description                                              |
| --------- | -------------------------------------------------------- |
| `to`      | Recipient address (templatable). **Required.**           |
| `subject` | Email subject (templatable). **Required.**               |
| `body`    | Email body (templatable). **Required.**                  |
| `from`    | Sender address (defaults to the configured SMTP sender). |
| `cc`      | Carbon-copy address(es) — string or array.               |
| `bcc`     | Blind-copy address(es) — string or array.                |
| `replyTo` | Reply-to address(es) — string or array.                  |

```yaml
- name: orderConfirmation
  type: email
  operator: send
  props:
    to: '{{trigger.data.customer_email}}'
    subject: 'Order {{trigger.data.id}} confirmed'
    body: 'Thanks for your order! Total: ${{trigger.data.amount}}'
    cc: [sales@example.com]
    replyTo: support@example.com
```

:::callout
**Email requires SMTP to be configured.** When `SMTP_HOST` is unset, email is disabled and the send is logged rather than delivered — Sovrium does not silently fall back to a local mail catcher in production. Configure SMTP via env vars (see [Environment Variables](/en/docs/automation-env-vars) and the app's auth/email settings).
:::

## Analytics — Track (Notifications & Metrics)

One operator. Emits a named event with arbitrary properties — the foundation for in-app notifications, usage metrics, and downstream sinks.

| Prop         | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| `event`      | Event name (e.g. `order.created`, `user.invited`). **Required.** |
| `properties` | Key-value event properties (templatable).                        |

```yaml
- name: trackSignup
  type: analytics
  operator: track
  props:
    event: user.signed_up
    properties:
      userId: '{{trigger.data.id}}'
      plan: '{{trigger.data.plan}}'
```

:::callout
**Notifications are event-driven.** Rather than a standalone notifications config block, Sovrium drives in-app and email notifications from automation events: an `analytics/track` event (or a record/auth trigger) fans out to channels, and an `email/send` action delivers the message. Compose these with [flow control](/en/docs/automation-flow-control) and [digest batching](/en/docs/automation-data-actions) for daily summaries.
:::

## Related Pages

- [Actions Overview](/en/docs/automation-actions-overview) — base props and the family map.
- [Environment Variables](/en/docs/automation-env-vars) — SMTP and provider secrets.
- [Data & State Actions](/en/docs/automation-data-actions) — `digest` for batching notifications.
- [Analytics](/en/docs/analytics) — the analytics surface that consumes tracked events.
