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

# Comms

# Comms templates (event emails)

## Overview

Manage customizable email templates sent to attendees during the event registration lifecycle — confirmation, pending approval, approved, denied, etc.

Templates are scoped to an **organizing event** under `/event/{organizingEvent}/comms`. Each template is identified by a `template` slug (e.g. `registration_confirmation`).

**Subscription:** Pro plan required. Upgrade at [https://app.animo.co/admin/settings/billing](https://app.animo.co/admin/settings/billing).

## Available templates

| Template                               | Value                                       | When sent                                                               |
| -------------------------------------- | ------------------------------------------- | ----------------------------------------------------------------------- |
| Registration confirmation              | `registration_confirmation`                 | After registration (paid tickets, or types that don't require approval) |
| Pending approval                       | `pending_approval`                          | After registration when approval is required                            |
| Registration approved                  | `registration_approved`                     | When an organizer approves a pending order                              |
| Registration approved (failed payment) | `registration_approved_with_failed_payment` | When approved but payment subsequently fails                            |
| Registration denied                    | `registration_denied`                       | When an organizer rejects a pending order                               |
| Registration abandoned                 | `registration_abandoned`                    | When a registrant abandons checkout                                     |

Templates marked as "private event" (`pending_approval`, `registration_approved`, `registration_approved_with_failed_payment`, `registration_denied`) are **only listed** when the event has at least one ticket type with `approval_required: true`. They can still be accessed individually via `show` regardless.

## Template variables

Use these placeholders in `subject` and `body`. They are replaced at send time:

| Variable         | Description                             |
| ---------------- | --------------------------------------- |
| `{event}`        | Event name                              |
| `{first_name}`   | Attendee first name                     |
| `{last_name}`    | Attendee last name                      |
| `{email}`        | Attendee email                          |
| `{ticket_type}`  | Ticket type name                        |
| `{order_url}`    | Link to the order page                  |
| `{order_button}` | Styled button linking to the order page |

## Default vs custom templates

* `is_default: true` — no custom override saved; `subject` and `body` reflect the system default for the event's locale
* `is_default: false` — a custom override exists in the database

`DELETE` resets a template back to the system default.

## Endpoints

### List comms templates

* **Method:** `GET`
* **Path:** `/api/v1/{company}/event/{organizingEvent}/comms`
* **Scope:** `events:read`
* **Subscription:** Pro plan (`USE_API`)

Returns all applicable templates for the event, merging saved overrides with defaults.

#### Response `200`

```json theme={null}
{
  "data": [
    {
      "template": "registration_confirmation",
      "subject": "🎫 Your registration for {event} has been confirmed!",
      "body": "<p>Hi {first_name},</p><p>You're registered for {event}.</p>",
      "is_default": true
    },
    {
      "template": "pending_approval",
      "subject": "⏳ Registration pending approval for {event}",
      "body": "<p>Hi {first_name}, your registration is being reviewed.</p>",
      "is_default": false
    }
  ]
}
```

#### Response fields

| Field        | Type    | Description                                           |
| ------------ | ------- | ----------------------------------------------------- |
| `template`   | string  | Template identifier — use as `{template}` path param  |
| `subject`    | string  | Email subject line (may contain variables)            |
| `body`       | string  | Email HTML body (may contain variables)               |
| `is_default` | boolean | `true` if using system default, `false` if customized |

***

### Show comms template

* **Method:** `GET`
* **Path:** `/api/v1/{company}/event/{organizingEvent}/comms/{template}`
* **Scope:** `events:read`
* **Subscription:** Pro plan (`USE_API`)

#### Path parameters

| Name       | Type   | Description                                      |
| ---------- | ------ | ------------------------------------------------ |
| `template` | string | Template value, e.g. `registration_confirmation` |

#### Response `200`

Single `MessageResource` in `data` envelope.

#### Errors

| Status | When                   |
| ------ | ---------------------- |
| `404`  | Unknown template value |

***

### Update comms template

* **Method:** `PATCH`
* **Path:** `/api/v1/{company}/event/{organizingEvent}/comms/{template}`
* **Scope:** `events:update`
* **Subscription:** Pro plan (`USE_API`)

Creates a custom override if none exists, or updates the existing one.

#### Request body

See the request body table below for field requirements.

At least one of `subject` or `body` is required.

```json theme={null}
{
  "subject": "🎫 You're in! {event}",
  "body": "<p>Hi {first_name},</p><p>Your spot at {event} is confirmed.</p><p>{order_button}</p>"
}
```

| Field     | Required            | Description                   |
| --------- | ------------------- | ----------------------------- |
| `subject` | One of subject/body | Email subject (max 255 chars) |
| `body`    | One of subject/body | Email HTML body               |

#### Response `200`

Returns the updated `MessageResource` with `is_default: false`.

***

### Reset comms template

* **Method:** `DELETE`
* **Path:** `/api/v1/{company}/event/{organizingEvent}/comms/{template}`
* **Scope:** `events:update`
* **Subscription:** Pro plan (`USE_API`)

Removes the custom override. The template reverts to the system default on next `show` or `index`.

#### Response `200`

```json theme={null}
{
  "status": "Deleted"
}
```

## Related

* [Authentication](../authentication.md)
* [Conventions](../conventions.md)
* [Events](events.md)
* [Event pages](event-pages.md)
* [Orders](orders.md)
