# Email, contacts, and notifications

> Flag bookmarks when matching email arrives, sync contacts from Nextcloud, and send alerts to email or chat.

- Web page: https://documentation.federated.computer/superbrain/email-contacts-notifications/

These features connect Superbrain to your mailbox, your contacts, and the places where your team already talks. Set them up in **Settings**.

## Email watchers

An email watcher checks your mailbox for messages from a particular sender or with a particular subject, and records each match on a bookmark as a **signal**. For example, add a watcher to a bookmark for a supplier's quote so you can see when they reply.

### Connect your mailbox

1. Open **Settings → IMAP**.
2. Enter your mail server's **Host**, **Port**, **Username**, **Password**, and the **Folder** to check (usually `INBOX`).
3. Select **Test Connection**, then **Save IMAP Settings**.

The connection must use TLS (port 993 by default). Superbrain stores your mailbox password encrypted.

### Add a watcher to a bookmark

1. Open the bookmark's details and go to **Mailbox Watch**.
2. Enter **Subject contains**, a **From address**, or both, and select **Add email watcher**.
3. Select **Check now** to look straight away.

Matches appear under **Signals** on the bookmark. Superbrain checks enabled watchers every five minutes, even when you're not signed in, and records each message only once.

## Contacts from Nextcloud

Superbrain can import your contacts from Nextcloud so you can attach a person to a bookmark, for example the client a document belongs to.

1. In Nextcloud, create an app password: open your avatar menu, then **Personal settings → Security → Devices & sessions**, and create a new app password. See [Nextcloud](https://documentation.federated.computer/apps/nextcloud/).
2. In Superbrain, open **Settings → Nextcloud / CardDAV**.
3. Enter the **Nextcloud URL** (it must start with `https://`), your **Username**, and the **App Password**. Leave **CardDAV Path** empty unless you want a specific address book.
4. Select **Sync Contacts Now**.

Superbrain uses the app password only for the sync and doesn't store it, so enter it again whenever you want to sync.

Open **Contacts** in the sidebar to see each person and the bookmarks linked to them.

## Notifications

Notifications send a message when something happens in Superbrain, even if it isn't open. Set them up in **Settings → Notifications**.

### Add a channel

A channel is where messages go. Select **Add channel**, choose a kind, give it a name, and fill in its details:

| Kind | What you need |
|---|---|
| Email | An address. Leave it blank to use your account's email. |
| Slack | An incoming webhook URL from Slack |
| Matrix | The homeserver URL, a room ID, and an access token. You can use [Element](https://documentation.federated.computer/apps/element/) on your Federated Core. |
| Telegram | A bot token and chat ID |

The kinds available depend on your plan.

### Create a rule

A rule decides when to send. Select a trigger, choose a channel, name the rule, and select **Create rule**. The triggers are:

- **A bookmark is due soon or overdue.** Choose how many hours ahead to warn.
- **New signal matches a mailbox watcher.**

You can turn rules and channels on and off without deleting them. **Recent notifications** lists what was sent and whether it was delivered.
