# Email Footer

An **Email Footer** is a reusable visual block appended to the very bottom of outgoing transactional email notifications sent by Gamopanda (such as streak milestone rewards, challenge completions, or failure notifications). It allows you to maintain consistent branding, compliance links (like unsubscribing), and legal info across different email templates.

:::tip
The `htmlContent` field is **localisable**. Pass a `languageCode` query parameter when updating or fetching the email footer to manage translations for international customers.
:::

---

## How it works

1. **Create an email footer** — define a name, description, status, and write the custom HTML content for your footer.
2. **Include compliance and links** — embed legal links (like terms of service, privacy policy) and required unsubscribe tags inside the HTML block.
3. **Use template variables** — use curly braces `{{ }}` to insert dynamic values. E.g., `{{ $account.name }}` dynamically inserts your account's name, and `{{ $metadata.unsubscribeUrl }}` inserts the unique unsubscribe link.
4. **Link to email templates** — associate the email footer with an **Email Template** by setting its `emailFooterId` field.
5. **Send branded emails** — when Gamopanda dispatches transactional emails using that template, the footer is dynamically appended to the email body.

---

## Fields

### Basic information

| Field | Type | Required | Max length | Description |
|---|---|---|---|---|
| `name` | string | ✅ | 256 | The name of the email footer |
| `description` | string | ❌ | 1 024 | A brief description of the email footer |
| `status` | enum | ✅ | — | `draft` · `live` · `paused` |

### Content settings

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `htmlContent` | string | ❌ | *(Default template)* | The HTML content of the email footer. Supports template variables using curly braces `{{ }}`. This field is localisable. |

:::note
The default `htmlContent` is set to:
```html
<div style="background-color: #f9fafb; padding: 20px; text-align: center; font-size: 12px; color: #999999;">
    <p>&copy; {{ $account.name }}. All rights reserved.</p>
    <p><a href="{{ $metadata.unsubscribeUrl }}" style="color: #999999; text-decoration: none;">Unsubscribe</a></p>
</div>
```
:::

### Template variables

The `htmlContent` field supports template variables resolved at runtime using curly braces `{{ }}`:

| Variable | Description | Example resolved value |
|---|---|---|
| `{{ $account.name }}` | The name of your Gamopanda account | `Acme Shop` |
| `{{ $metadata.unsubscribeUrl }}` | Unique, secure link for the recipient to opt out of emails | `https://api.gamopanda.com/unsubscribe/usr_123` |

---

## Real-world examples

**🛍️ E-commerce — Default Brand Footer**

Used for standard customer communications containing legal and unsubscribe links.

```json
{
  "name": "Default Brand Footer",
  "description": "Standard corporate branding footer with unsubscribe links.",
  "status": "live",
  "htmlContent": "<div style=\"background-color: #f3f4f6; padding: 20px; text-align: center; font-family: sans-serif; font-size: 12px; color: #6b7280;\"><p>&copy; 2026 {{ $account.name }}. All rights reserved.</p><p><a href=\"#\" style=\"color: #4b5563; margin-right: 12px;\">Terms of Service</a> | <a href=\"#\" style=\"color: #4b5563; margin-left: 12px;\">Privacy Policy</a></p><p style=\"margin-top: 16px;\">Sent to you by Gamopanda. <a href=\"{{ $metadata.unsubscribeUrl }}\" style=\"color: #3b82f6; text-decoration: underline;\">Unsubscribe here</a></p></div>"
}
```

---

## Access & permissions

| Caller | Allowed operations | Notes |
|---|---|---|
| Admin | CREATE · GET · LIST · UPDATE · DELETE | Full control over email footers |
| End user | *(none)* | No access |
| Guest user | *(none)* | No access |

---

## Related resources

| Resource | Description |
|---|---|
| [Email Header](/email-header) | Reusable HTML header prepended to transactional emails |
| [Email Template](/email-template) | Custom templates wrapping the notification message body |
| [Email Notification](/email-notification) | Subscribed transactional email notification configurations |

---

## API reference

See the [API Reference](/api/email_footer) for full request/response schemas and interactive examples for:

- `GET /schema/email_footer/record` — list email footers
- `POST /schema/email_footer/record` — create an email footer
- `GET /schema/email_footer/record/{id}` — get an email footer by ID
- `PATCH /schema/email_footer/record/{id}` — update an email footer
- `DELETE /schema/email_footer/record/{id}` — delete an email footer
