> For the complete documentation index, see [llms.txt](https://docs.elimity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elimity.com/reference-manual/v3.44.2/server-configuration/template-overrides.md).

# Template overrides

The v3.29.0 release added a new `TemplatesPath` configuration option for overriding various HTML and plain-text templates in Elimity Insights. This article provides detailed information about how to use this feature. Correctly configuring `TemplatesPath` requires a technical background, so we recommend this feature only for advanced deployments.

The value of the `TemplatesPath` configuration option in `elimity.yml` (if provided) must be a path to an existing directory on the Elimity Insights server:

```yaml
# TemplatesPath
# ----------------------------
#
# Data type: string
#
# Status: Optional
#
# Description: The directory path to use for overriding various HTML and plain-text templates in Elimity Insights.
```

The given directory must at least contain the following files:

* `access-review-welcome-screen.html.tmpl`
* `link.html.tmpl`
* `link.txt.tmpl`
* `link-subject.txt.tmpl`

These files should contain Go templates to customize various parts of Elimity Insights. There are multiple resources providing more information about Go templates, [the official documentation](https://pkg.go.dev/text/template) is a good place to start. You should also take a look at Elimity Insights' default templates, which we use when the \`TemplatesPath\` configuration option is not set:

{% file src="/files/B9jErrDJeWkP1gfwGioo" %}

{% file src="/files/5vxLN984OeG26xxTXn3w" %}

{% file src="/files/z9rxunYpobWaXKNTkNGg" %}

{% file src="/files/4qCMdrcKwpWP3y452J8n" %}

The following sections will explain the role of each template in more detail.

## Customizing access review welcome screens

The `access-review-welcome-screen.html.tmpl` template allows customizing the contents of the first screen users see when opening an access review request link:

<figure><img src="/files/UISWN5kDHGwvV26G79Z7" alt=""><figcaption></figcaption></figure>

This template has access to the following variables:

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>.AssigneeName</code></td><td>Name of the access review's assignee</td><td><code>string</code></td></tr><tr><td><code>.CampaignName</code></td><td>Name of the access review's campaign</td><td><code>string</code></td></tr><tr><td><code>.CreatedAt</code></td><td>Timestamp indicating when the access review was created</td><td><code>time.Time</code></td></tr><tr><td><code>.DueDate</code></td><td>Timestamp indicating when the access review's campaign is due</td><td><code>time.Time</code></td></tr></tbody></table>

## Customizing emails

The `link.html.tmpl`, `link.txt.tmpl` and `link-subject.txt.tmpl` templates allow customizing various emails sent by Elimity Insights. They represent the email's HTML body, TXT body and subject line respectively. More specifically, we use these templates for six types of emails:

1. Invitations to new user accounts
2. Requests to fill in an access review
3. Reminders to fill in an access review
4. Notifications about missing imports
5. Requests to verify notification channels
6. Notifications about stored query subscriptions

All three templates have access to all variables listed below, but some variables will only have a meaningful value for a specific type of email.

### Common variables

The following variables always have a meaningful value regardless of the type of email:

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th><th>Value</th></tr></thead><tbody><tr><td><code>.AccessReviewRequest</code></td><td>Indicates whether the current email is an access review request (or reminder)</td><td><code>bool</code></td></tr><tr><td><code>.Action</code></td><td>Label for the primary action button (e.g. <code>"PERFORM ACCESS REVIEW"</code> or <code>"ACCEPT INVITE"</code>)</td><td><code>string</code></td></tr><tr><td><code>.FailedHealthCheck</code></td><td>Indicates whether the current email is a notification for missing imports</td><td><code>bool</code></td></tr><tr><td><code>.Header</code></td><td>Main header for the email (e.g. <code>"Submit access review"</code> or <code>"Join Elimity Insights"</code>)</td><td><code>string</code></td></tr><tr><td><code>.NotificationChannelVerification</code></td><td>Indicates whether the current email is a notification channel verification request</td><td><code>bool</code></td></tr><tr><td><code>.NotificationTriggers</code></td><td>Lists all stored query subscriptions that triggered, empty slice if this email is not a notification about stored query subscriptions</td><td><code>[]notificationTrigger</code></td></tr><tr><td><code>.Subheader</code></td><td>Subheader for the email (e.g. <code>"Your input is needed"</code> or <code>"You have been invited"</code>)</td><td><code>string</code></td></tr><tr><td><code>.TenantName</code></td><td>The name of your organization.</td><td><code>string</code></td></tr><tr><td><code>.Title</code></td><td>Main title for the email (e.g. <code>"You have been requested to submit an access review"</code> or <code>"You are invited to Elimity Insights"</code>)</td><td><code>string</code></td></tr><tr><td><code>.URL</code></td><td>URL that the recipient should visit to perform the primary action (e.g. perform access review or accept invite)</td><td><code>string</code></td></tr><tr><td><code>renderNotificationCondition</code></td><td>Helper function to construct a textual description for the given notification trigger condition</td><td><code>func (notificationCondition) string</code></td></tr><tr><td><code>renderNotificationTriggerURL</code></td><td>Helper function to construct a link to the stored query page in Elimity Insights, for a given notification trigger</td><td><code>func (notificationTrigger) string</code></td></tr></tbody></table>

### Variables for invitations

The following variables will only have a meaningful value if the email is an invitation (if `.AccessReviewRequest` and `.FailedHealthCheck` are both `false`):

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>.TenantName</code></td><td>The name of your organization</td><td><code>string</code></td></tr></tbody></table>

### Variables for access review requests and access review reminders

The following variables will only have a meaningful value if the email is an access review request or an access review reminder (if `.AccessReviewRequest` is `true`):

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>.CampaignMeta</code></td><td>Map of the campaign's metadata as configured by the access review managers</td><td><code>map[string]string</code></td></tr><tr><td><code>.CampaignName</code></td><td>Name of the access review's campaign</td><td><code>string</code></td></tr><tr><td><code>.CreatorEmail</code></td><td>Email address of the access review's creator</td><td><code>string</code></td></tr><tr><td><code>.DueDate</code></td><td>Timestamp indicating when the access review's campaign is due</td><td><code>time.Time</code></td></tr><tr><td><code>.Reminder</code></td><td>Indicates whether the current email is a reminder for an access review request</td><td><code>bool</code></td></tr></tbody></table>

### Variables for missing import notifications

The following variables will only have a value if the email is a notification about a missing import (if `.FailedHealthCheck` is `true`):

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>.HealthCheckSnapshotMaxAge</code></td><td>Maximum age of the snapshot in days for which imports are missing</td><td><code>int64</code></td></tr></tbody></table>

### Variables for notification channel verifications

The following values will only have a value if the email is a request to verify a notification channel (if `.NotificationChannelVerification` is `true`):

<table data-full-width="true"><thead><tr><th>Variable</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>.NotificationChannelDescription</code></td><td>Description of the notification channel</td><td><code>string</code></td></tr><tr><td><code>.NotificationChannelName</code></td><td>Name of the notification channel</td><td><code>string</code></td></tr></tbody></table>

### Notification triggers

The `.NotificationTriggers` template variable lists all stored queries for which at least one subscription in the notification channel has triggered. Each element in this list is a `notificationTrigger` object with the following fields:

<table data-full-width="true"><thead><tr><th>Field</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>AdditionCount</code></td><td>Number of added stored query results in the triggering history point</td><td><code>int64</code></td></tr><tr><td><code>Conditions</code></td><td>Lists all conditions that matched for this stored query</td><td><code>[]notificationCondition</code></td></tr><tr><td><code>HistoryPointID</code></td><td>Unique identifier of the history point that was added for this stored query</td><td><code>int64</code></td></tr><tr><td><code>QueryID</code></td><td>Unique identifier of this stored query</td><td><code>int64</code></td></tr><tr><td><code>QueryName</code></td><td>Name of this stored query</td><td><code>string</code></td></tr><tr><td><code>RemovalCount</code></td><td>Number of removed stored query results in the triggering history point</td><td><code>int64</code></td></tr></tbody></table>

### Notification conditions

Each notification trigger refers to a stored query for which at least one subscription has triggered. The `Conditions` field of a `notificationTrigger` object lists precisely which subscriptions matched and why. Each element in this list is a `notificationCondition` object with the following fields:

<table data-full-width="true"><thead><tr><th>Field</th><th>Description</th><th>Type</th></tr></thead><tbody><tr><td><code>ResultsChangedAddition</code></td><td>Indicates whether the stored query subscription matched because new results were added. This field is only relevant if the <code>Type</code> field equals <code>"results_changed"</code></td><td><code>bool</code></td></tr><tr><td><code>ResultsChangedMinPct</code></td><td>Indicates the minimum percentage of change in result count (added or removed) that was exceeded. This field is only relevant if the <code>Type</code> field equals <code>"results_changed"</code></td><td><code>int64</code></td></tr><tr><td><code>ThresholdCrossedValue</code></td><td>Indicates the threshold value that was crossed (from either direction). This field is only relevant if the <code>Type</code> field equals <code>"threshold_crossed"</code></td><td><code>int64</code></td></tr><tr><td><code>Type</code></td><td><p></p><p>Indicates which type of condition matched; one of <code>"control_status_changed"</code>, <code>"history_point_added"</code>, <code>"results_changed"</code> or <code>"threshold_crossed"</code></p></td><td><code>string</code></td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.elimity.com/reference-manual/v3.44.2/server-configuration/template-overrides.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
