> 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-bulk-email-with-template-parameters.md).

# Sending Bulk Email with Template Parameters

Fill the named placeholders of a panel email template with values from your own system at send time.

This recipe shows how to send an email from a template that has several named placeholders, such as a date, a title, a content block, and a file link. The template is prepared once in the panel. At send time, your system provides the values of the placeholders in the request, so the content of each send is managed from your side and you do not need to open the panel again.

## When to Use

This recipe fits emails whose layout stays the same and whose values change with every send, such as a daily bulletin, a periodic report notice, or an announcement with a link to a document. To replace the whole body of the email with HTML from another system, 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
* Permission to create email templates in the panel
* A tag or segment that represents the target audience

{% hint style="info" %}
Mail templates are created in the panel. There is no REST API service that creates templates. The REST API triggers a template that already exists.
{% endhint %}

## Step 1: Create the Template with Parameters in the Panel

Create a mail template in the Netmera panel and add a placeholder for every value that changes. Write each placeholder in the `@{NAME}` format, in the place of the content where the value should appear.

```html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta content="width=device-width, initial-scale=1" name="viewport">
  </head>
  <body class="body">
    <p>@{DATE}</p>
    <h2>@{TITLE}</h2>
    <p>@{CONTENT}</p>
    <p><a href="@{PDF_URL}">Download the report</a></p>
  </body>
</html>
```

After saving the template, note the **Template ID**. It is available in the URL of the template editing screen and is used as `emailTemplateId` in the next step.

**Expected result:** A saved template that contains the placeholders, and a noted Template ID.

## Step 2: Send the Values with the Request

Call `sendBulkEmail` with the Template ID, the subject of this send, and the values of the placeholders in `customParams`. Each key in `customParams` is the name of a placeholder, written without the `@{}` characters.

```bash
curl https://<REST_API_URL>/rest/3.0/sendBulkEmail \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-netmera-api-key: <API_KEY>' \
  --data '{
  "emailTemplateId": <TEMPLATE_ID>,
  "subject": "Daily Bulletin - October 15",
  "customParams": {
    "DATE": "15.10.2026",
    "TITLE": "Market Summary",
    "CONTENT": "The main index increased today.",
    "PDF_URL": "https://cdn.example.com/report.pdf"
  },
  "target": {
    "tag": "sample-mail-tag"
  }
}'
```

Replace `<REST_API_URL>` with the REST API address of the environment, `<API_KEY>` with the API key of the application, and `<TEMPLATE_ID>` with the Template ID noted in Step 1.

The parameters are applied at campaign level: the values in one request are used for the email of every recipient of that request. To send other values, send another request with different `customParams`.

{% hint style="warning" %}
If the template contains a placeholder and `customParams` has no key with the same name, the placeholder is rendered empty in the delivered email. Check that every placeholder in the template has a matching key.
{% endhint %}

{% hint style="info" %}
The `sendBulkEmail` examples in this guide target a tag or a segment. The Notifications page also shows `"sendToAll": true` to send to all users.
{% endhint %}

**Expected result:** The request is accepted with HTTP 200.

## Step 3: Track the Response and Reporting

The response contains the `notificationKey` of the email campaign created in the panel for this send:

```json
{
  "notificationKey": 1234567
}
```

Use this ID to open the report of the send in the panel. Email reports in the panel show metrics per template and campaign. To follow the email interactions of a single user, open the user detail page of that user in the panel.

**Expected result:** An email campaign in the panel that matches the `notificationKey`, with its report screen.

## Verification Checklist

* Every placeholder in the template is written in the `@{NAME}` format
* Each placeholder has a key with the same name in `customParams`
* The Template ID is sent as `emailTemplateId`
* `target` is defined with a tag or a segment
* The `notificationKey` returned in the response is recorded for reporting

## Related Pages

For the request format, see the Trigger an Existing Email Template via API section of the [Notifications](/netmera-developer-guide/api-documentation/rest-api/notifications.md) page in the REST API documentation. For authentication and request headers, see [Setup](/netmera-developer-guide/api-documentation/rest-api/setup.md). To send a one-to-one email, see [Sending a Transactional Email to a Single User](/netmera-developer-guide/api-documentation/recipes/sending-transactional-email.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-bulk-email-with-template-parameters.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.
