> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.etera.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.etera.dev/_mcp/server.

# Send email notification with React Email template

POST https://api.etera.dev/notification/email/send
Content-Type: application/json

Send email notifications using React Email templates with automatic HTML and plain text rendering.

**Features:**

* 🎨 **Professional Templates**: Pre-built React Email templates (OTP, Welcome, Invite)
* 📧 **Automatic Rendering**: Templates rendered to both HTML and plain text
* 👥 **Multiple Recipients**: Send to multiple email addresses
* 📊 **Tracking**: Optional delivery tracking by userId
* 🏷️ **Tagging**: Categorize emails with tags
* ⚡ **Priority**: Set delivery priority (high/normal)

**Available Templates:**

1. **OTP Template** (`templateType: "otp"`)
   * Props: `{ otpCode, userName?, expiryMinutes?, companyName?, supportEmail? }`
   * Use case: Authentication, verification codes
   * Example OTP code display with security tips

2. **Welcome Template** (`templateType: "welcome"`)
   * Props: `{ userName?, userEmail?, companyName?, dashboardUrl?, supportEmail? }`
   * Use case: New user onboarding
   * Includes getting started guide and dashboard link

3. **Invite Template** (`templateType: "invite"`)
   * Props: `{ userName?, userEmail?, companyName?, inviteUrl?, supportEmail?, expiryHours?, phoneNumber? }`
   * Use case: Early access / beta program invitations
   * Includes onboarding steps, feature highlights, and TestFlight instructions

4. **Booking Confirmation Template** (`templateType: "booking-confirmation"`)
   * Props: `{ userName?, bookingId?, experienceTitle?, experienceDate?, validUntil?, guests?, openTime?, purchasedBy?, location?, locationAddress?, partnerName?, partnerPhone?, partnerRefNumber?, viewTicketUrl?, getDirectionsUrl?, heroImageUrl?, companyName? }`
   * Use case: Booking confirmation emails
   * Includes reservation details, ticket info, and location

5. **Booking Cancellation Template** (`templateType: "booking-cancellation"`)
   * Props: `{ userName?, bookingId?, experienceTitle?, cancellationDate?, refundMessage?, companyName?, supportEmail? }`
   * Use case: Booking cancellation notifications
   * Includes cancellation details and refund information

**Authentication:**

* Requires valid Bearer token
* Test tokens available for development: `test-jwt-token`, `agent-jwt-token`

**Example Request:**

```json
{
  "recipients": ["user@example.com"],
  "templateType": "otp",
  "templateProps": {
    "otpCode": "123456",
    "userName": "John Doe",
    "expiryMinutes": 10
  },
  "userId": "user-123",
  "options": {
    "priority": "high",
    "tags": ["authentication", "login"],
    "category": "general"
  }
}
```

**Response Codes:**

* 200: Email sent successfully
* 400: Invalid request or email send failed
* 401: Authentication required or failed

**Best Practices:**

* Always provide `userId` for tracking
* Use `priority: "high"` for time-sensitive emails (OTP, verification)
* Add relevant tags for analytics and filtering
* Provide user context (userName, userEmail) for personalization

Reference: https://docs.etera.dev/platform/notifications/notification-api/email-notifications/post-email-send

## Authentication

- `Authorization` header (bearer token, required) — JWT token for authentication. Use 'test-jwt-token' for development.

## Servers

- `https://api.etera.dev/notification` (Production, default)
- `https://api-stage.etera.dev/notification` (Staging)
- `https://api-dev.etera.dev/notification` (Development)

## Request

### Body (application/json)

This endpoint expects an object.

- `recipients` (list of string, required) — Array of recipient email addresses
- `templateType` (EmailSendPostRequestBodyContentApplicationJsonSchemaTemplateType, required) — Type of email template to use
- `templateProps` (EmailSendPostRequestBodyContentApplicationJsonSchemaTemplateProps, required) — Props specific to the template type
- `userId` (string, optional) — Optional user ID for tracking email delivery
- `options` (EmailSendPostRequestBodyContentApplicationJsonSchemaOptions, optional) — Optional email configuration

## Response

### 200

- `success` (boolean, required)
- `data` (EmailSendPostResponsesContentApplicationJsonSchemaData, optional)
- `error` (EmailSendPostResponsesContentApplicationJsonSchemaError, optional)

## Types

### EmailSendPostRequestBodyContentApplicationJsonSchemaTemplateType

Type of email template to use

- "otp"
- "welcome"
- "invite"
- "booking-confirmation"
- "booking-cancellation"

### EmailSendPostRequestBodyContentApplicationJsonSchemaTemplateProps

Props specific to the template type

### EmailSendPostRequestBodyContentApplicationJsonSchemaOptions

Optional email configuration

- `priority` (EmailSendPostRequestBodyContentApplicationJsonSchemaOptionsPriority, optional) — Email delivery priority
- `tags` (list of string, optional) — Tags for categorizing emails
- `category` (EmailSendPostRequestBodyContentApplicationJsonSchemaOptionsCategory, optional) — Email category

### EmailSendPostResponsesContentApplicationJsonSchemaData

- `success` (boolean, required)
- `recipients` (list of string, optional)
- `error` (string, optional)

### EmailSendPostResponsesContentApplicationJsonSchemaError

- `message` (string, required)
- `code` (string, optional)
- `details` (any, optional)

### EmailSendPostRequestBodyContentApplicationJsonSchemaOptionsPriority

Email delivery priority

- "high"
- "normal"

### EmailSendPostRequestBodyContentApplicationJsonSchemaOptionsCategory

Email category

- "general"
- "restaurant"
- "hotel"
- "experiences"
- "flights"

## Examples

**Request**

```json
{
  "recipients": [
    "string"
  ],
  "templateType": "otp"
}
```

**Response**

```json
{
  "success": true,
  "data": {
    "success": true,
    "recipients": [
      "string"
    ],
    "error": "string"
  },
  "error": {
    "message": "string",
    "code": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.etera.dev/notification/email/send"

payload = {
    "recipients": ["string"],
    "templateType": "otp"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.etera.dev/notification/email/send';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"recipients":["string"],"templateType":"otp"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.etera.dev/notification/email/send"

	payload := strings.NewReader("{\n  \"recipients\": [\n    \"string\"\n  ],\n  \"templateType\": \"otp\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.etera.dev/notification/email/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"recipients\": [\n    \"string\"\n  ],\n  \"templateType\": \"otp\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.etera.dev/notification/email/send")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"recipients\": [\n    \"string\"\n  ],\n  \"templateType\": \"otp\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.etera.dev/notification/email/send', [
  'body' => '{
  "recipients": [
    "string"
  ],
  "templateType": "otp"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.etera.dev/notification/email/send");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"recipients\": [\n    \"string\"\n  ],\n  \"templateType\": \"otp\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "recipients": ["string"],
  "templateType": "otp"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.etera.dev/notification/email/send")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```