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

# Notification Endpoints

> Internal email delivery system and notification templates

> **Source:** Cross-cutting guide — references `equa-server/modules/notifications/` and the `Notifier` interface used across endpoint handlers

# Notification Endpoints

The Equa notification system handles email delivery for authentication events, member invitations, and other platform communications. This is an **internal service** — there are no direct user-facing notification API endpoints.

## How Notifications Work

Notifications are sent server-side through a `Notifier` function injected into endpoint handlers. When an action requires an email (e.g., invitation, password reset, magic link), the handler calls `notify(userId, options)` internally.

## Notification Triggers

The following actions trigger email notifications:

| Trigger                | Template                  | Description                                     |
| ---------------------- | ------------------------- | ----------------------------------------------- |
| User registration      | Verification email        | Email with verification code                    |
| Password reset request | Password reset email      | Link to reset password                          |
| Magic link request     | Magic link email          | Passwordless login link (expires in 15 minutes) |
| Member invitation      | Invitation email          | Invite to join an organization                  |
| Admin invitation       | Admin invitation email    | Admin-level user invitation                     |
| Referral invitation    | Referral invitation email | Invite a friend to Equa                         |
| Support contact        | Support email             | Forward user's support request                  |

## Email Transport

The email transport is configured via environment variables:

| Variable            | Description                                                 |
| ------------------- | ----------------------------------------------------------- |
| `EMAIL_TRANSPORTER` | Transport type (`dev` saves to temp folder, otherwise SMTP) |
| `SMTP_HOST`         | SMTP server hostname                                        |
| `SMTP_PORT`         | SMTP server port                                            |
| `SMTP_USER`         | SMTP authentication username                                |
| `SMTP_PASS`         | SMTP authentication password                                |

In development mode (`EMAIL_TRANSPORTER=dev`), emails are saved to a local `temp/` folder instead of being sent.

## Magic Link Emails

Magic link emails include:

* A secure sign-in URL valid for 15 minutes
* The link is single-use (marked as used after verification)
* In dev mode, the token is included in the API response for testing

## Template System

Email templates are managed through the notification module (`modules/notifications`). Templates use Handlebars for variable interpolation. The magic link template is located at:

```
modules/notifications/src/templates/magicLink.handlebars
```

## Integration Notes

* There is no REST endpoint to send arbitrary notifications
* All notification sending is triggered by server-side business logic
* Email verification has a cooldown (`EMAIL_VERIFICATION_LIMIT_SECONDS`, default 1800s)
* The `Notifier` abstraction supports multiple transport backends
