> For the complete documentation index, see [llms.txt](https://user.netmera.com/netmera-developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://user.netmera.com/netmera-developer-guide/api-documentation/recipes/sending-transactional-email.md).

# Sending a Transactional Email to a Single User

Send an email from a panel template to a single recipient, after adding the address to Netmera.

This recipe shows how to send an email that is defined in the Netmera panel to a single recipient, and how to add the recipient's address to Netmera before the send. Your backend triggers the email right after an event, and Netmera delivers the content of the template.

## When to Use

This recipe fits one-to-one emails that your system sends after an event, such as an account creation notice, an order confirmation, or a password reset notice. To send a different HTML body in every send, see [Sending Bulk Email with Dynamic HTML Content](/netmera-developer-guide/api-documentation/recipes/sending-bulk-email-with-dynamic-html.md).

## Prerequisites

* REST API key of the application
* The `notificationKey` of an email notification created in the Netmera panel
* The email address of the recipient

## Step 1: Add the Email Address to Netmera

If the recipient is not a Netmera user yet, upload the address with `addEmail`. The request takes a list, so several addresses can be added at once.

```bash
curl https://restapi.netmera.com/rest/3.0/addEmail \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-netmera-api-key: <API_KEY>' \
  --data '{
  "emailList": ["john.brown@example.com"]
}'
```

{% hint style="info" %}
If a user with the same email already exists, for example a user with an external ID, a new user is not created. A user created with `addEmail` has no installation ID. If the SDK later creates a user with the same email, the user created with `addEmail` is deleted, because the information from the SDK is considered primary and targeting is done on the SDK user.
{% endhint %}

**Expected result:** The address is available in Netmera as a recipient.

## Step 2: Send the Email

Call `sendNotification` with the `notificationKey` of the email and the address of the recipient in `target.email`.

```bash
curl https://restapi.netmera.com/rest/3.0/sendNotification \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-netmera-api-key: <API_KEY>' \
  --data '{
  "notificationKey": "12",
  "target": {
    "email": "john.brown@example.com"
  },
  "message": {
    "params": {}
  }
}'
```

**Expected result:** The request is sent with the key of the email created in the panel and the address of the recipient.

## Step 3: Attach Files When Needed

To send an email with attachments, use `sendEmailWithAttachment`. The request is a multipart form with the fields `mailAttachment`, `to`, and `notificationKey`. More than one attachment can be added.

{% hint style="warning" %}
The email size and the total size of the attachments must not exceed 10 MB. Supported file types include `png`, `jpg`, `jpeg`, `gif`, `pdf`, `csv`, `txt`, `xls`, `xlsx`, `mp4`, `mpeg`, and `avi`.
{% endhint %}

For the full request, see Send Email with Attachment on the [Notifications](/netmera-developer-guide/api-documentation/rest-api/notifications.md) page.

## Verification Checklist

* The `notificationKey` belongs to an email created in the Netmera panel and is sent as a string
* `target.email` contains the address of the recipient
* `addEmail` is used only to add addresses, and the SDK user is treated as primary when the same email exists
* The email and its attachments together stay within 10 MB

## Related Pages

For the email request formats, see the Email section of the [Notifications](/netmera-developer-guide/api-documentation/rest-api/notifications.md) page. For authentication and request headers, see [Setup](/netmera-developer-guide/api-documentation/rest-api/setup.md). To record the consent of the recipient first, see [Managing Channel Permissions and Category Preferences](/netmera-developer-guide/api-documentation/recipes/managing-channel-and-category-preferences.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://user.netmera.com/netmera-developer-guide/api-documentation/recipes/sending-transactional-email.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
