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

# Email

> How Maqetin sends transactional email, from your server or from a journey: opt-in and suppressions, unsubscribe, the footer and tracking.

Email is the channel Maqetin sends today: transactional email, mail a person gets because of something they did. Every email goes out from a verified [sending domain](https://docs.maqetin.com/messaging/sending-domains.md) of your workspace, with a [template](https://docs.maqetin.com/messaging/templates.md) you wrote.

## Before the first email

**1. Get sending approval**

No email leaves a workspace until Maqetin staff approve it, a transactional one and a test included. The owner or an admin asks for it. See [Sending approval](https://docs.maqetin.com/workspace/sending-approval.md).

**2. Verify a sending domain**

Its DKIM, return-path and tracking records must verify. See [Sending domains](https://docs.maqetin.com/messaging/sending-domains.md).

## Two ways to send

```mermaid theme={null}
flowchart LR
  A["API send"] --> SA{"Address suppressed?"}
  J["Journey Send email step"] --> SJ{"Opt-in on and address not suppressed?"}
  SA -- "No" --> OK["Sent"]
  SA -- "Yes" --> NO["Not sent"]
  SJ -- "Yes" --> OK
  SJ -- "No" --> NO
```

| | API send | Journey email |
| - | - | - |
| Sent by | Your server, through [`POST /v1/public/messages`](https://docs.maqetin.com/api-reference/send-message) with a secret key | A journey's **Send email** step |
| Recipient | A contact by `userId`, or an address with no contact | A contact |
| Email opt-in | Ignored | Must be on |
| Suppressed address | Never sent | Never sent |
| Unsubscribe link and headers | None | Added to every email |
| Postal address in the footer | Yes | Yes |
| Click and open tracking | Yes | Yes |
| Sender | `from`, as `Name <local@domain>` or `local@domain`. Without a name, the workspace name is used | **Sender name**, **Address** (the part before the `@`) and **Sending domain** |

Use an API send for what a person needs whatever their opt-in: a receipt, a one-time code, a password reset. Use a journey to send an email when a person does, or stops doing, something. Either way, the sender's domain must be a verified sending domain of the workspace.

## Opt-in and suppressions

* **Email opt-in.** Every contact has one, on by default. Set the trait `emailOptIn` to `false` with `identify` to turn it off; once a call made with a secret key sets it, only another call made with a secret key can change it. See [Profiles](https://docs.maqetin.com/data/profiles.md). Off stops journey email; an API send still goes.
* **The suppression list.** An address on it gets no email at all from the workspace, an API send included. An address is added when it hard-bounces, when the person marks an email as spam or unsubscribes, or when the owner adds it by hand. See [Suppressions](https://docs.maqetin.com/messaging/suppressions.md).

A hard bounce, a spam complaint and an unsubscribe also turn the contact's opt-in off. The contact's page in the console shows both: the email opt-in, and whether Maqetin mails the address.

## Unsubscribe

Every journey email carries an **Unsubscribe** link in its footer, and the headers mailbox providers use for one-click unsubscribe. Both point at a page on your own tracking host, `link.<your domain>`, and the address is never in the link. Email sent through the API carries no unsubscribe link.

An unsubscribe turns the contact's email opt-in off and adds their address to the suppression list with the reason `unsubscribe`, for good: that address then gets no email from the workspace, an API send included. If the contact's address has changed since the email went out, only the opt-in is turned off.

## The footer

Maqetin adds a footer to the end of every email, inside the body. Your template cannot remove or change it.

* The postal address of the sending domain, on every email. You set it, 5 to 300 characters, when you add the domain, which cannot be added without one. You can change it later; the next email carries the new address.
* The **Unsubscribe** link, on journey email only.

## Tracking

Maqetin rewrites every `http` and `https` link to go through your tracking host, `link.<your domain>`, and adds an open pixel. A click is recorded, then the person goes on to the link's destination.

* `mailto:`, `tel:` and relative links, and links to `#`, stay as you wrote them.
* A link whose destination holds the recipient's address stays as you wrote it, so the address never reaches a tracking link.
* Opens and clicks that look like a mail scanner are flagged and left out of every count and every journey check.

## What Maqetin keeps

Each message's subject, status and events: sent, delivered, opened, clicked, bounced, unsubscribed or failed. Not the body. The contact's **Messages** tab lists every email they got. See [Analytics](https://docs.maqetin.com/messaging/analytics.md).


## Related topics

- [Analytics](https://docs.maqetin.com/messaging/analytics.md)
- [Journeys](https://docs.maqetin.com/messaging/journeys.md)
- [JavaScript SDK](https://docs.maqetin.com/sdk/javascript.md)
- [Quickstart](https://docs.maqetin.com/quickstart.md)
- [Templates](https://docs.maqetin.com/messaging/templates.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.