2020-02-29 00:43:59 +00:00
---
layout: default
title: Notifier
parent: Configuration
2021-06-01 04:09:50 +00:00
nav_order: 8
2020-02-29 00:43:59 +00:00
has_children: true
---
# Notifier
**Authelia** sometimes needs to send messages to users in order to
verify their identity.
[FEATURE] Notifier Startup Checks (#889)
* implement SMTP notifier startup check
* check dial, starttls, auth, mail from, rcpt to, reset, and quit
* log the error on failure
* implement mock
* misc optimizations, adjustments, and refactoring
* implement validate_skip config option
* fix comments to end with period
* fix suites that used smtp notifier without a smtp container
* add docs
* add file notifier startup check
* move file mode into const.go
* disable gosec linting on insecureskipverify since it's intended, warned, and discouraged
* minor PR commentary adjustment
* apply suggestions from code review
Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
2020-04-21 04:59:38 +00:00
2021-04-11 11:25:03 +00:00
## Configuration
[FEATURE] Notifier Startup Checks (#889)
* implement SMTP notifier startup check
* check dial, starttls, auth, mail from, rcpt to, reset, and quit
* log the error on failure
* implement mock
* misc optimizations, adjustments, and refactoring
* implement validate_skip config option
* fix comments to end with period
* fix suites that used smtp notifier without a smtp container
* add docs
* add file notifier startup check
* move file mode into const.go
* disable gosec linting on insecureskipverify since it's intended, warned, and discouraged
* minor PR commentary adjustment
* apply suggestions from code review
Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
2020-04-21 04:59:38 +00:00
```yaml
notifier:
disable_startup_check: false
2022-04-03 12:24:51 +00:00
template_path: /path/to/templates/folder
2021-04-11 11:25:03 +00:00
filesystem: {}
smtp: {}
[FEATURE] Notifier Startup Checks (#889)
* implement SMTP notifier startup check
* check dial, starttls, auth, mail from, rcpt to, reset, and quit
* log the error on failure
* implement mock
* misc optimizations, adjustments, and refactoring
* implement validate_skip config option
* fix comments to end with period
* fix suites that used smtp notifier without a smtp container
* add docs
* add file notifier startup check
* move file mode into const.go
* disable gosec linting on insecureskipverify since it's intended, warned, and discouraged
* minor PR commentary adjustment
* apply suggestions from code review
Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
2020-04-21 04:59:38 +00:00
```
2021-04-11 11:25:03 +00:00
## Options
### disable_startup_check
< div markdown = "1" >
type: boolean
{: .label .label-config .label-purple }
default: false
{: .label .label-config .label-blue }
required: no
{: .label .label-config .label-green }
< / div >
The notifier has a startup check which validates the specified provider
configuration is correct and will be able to send emails. This can be
disabled with the `disable_startup_check` option:
2022-04-03 12:24:51 +00:00
### template_path
< div markdown = "1" >
type: string
{: .label .label-config .label-purple }
default: ""
{: .label .label-config .label-blue }
required: no
{: .label .label-config .label-green }
< / div >
2022-04-07 03:05:20 +00:00
This option allows the administrator to set a path where custom templates for notifications can be found. Each template
has two extensions; `.html` for HTML templates, and `.txt` for plaintext templates.
2022-04-03 12:24:51 +00:00
2022-04-07 03:05:20 +00:00
| Template | Description |
|:--------------------:|:-----------------------------------------------------------------------------------------------:|
| IdentityVerification | Template used when registering devices or resetting passwords |
| PasswordReset | Template used to send the notification to users when their password has successfully been reset |
2022-04-03 12:24:51 +00:00
2022-04-07 03:05:20 +00:00
For example, to modify the `IdentityVerification` HTML template, if your `template_path` was `/config/email_templates` ,
you would create the `/config/email_templates/IdentityVerification.html` file.
_**Note:** you may configure this directory and add only add the templates you wish to override, any templates not
2022-06-02 09:29:15 +00:00
supplied in this folder will utilize the default templates._
2022-04-03 12:24:51 +00:00
In template files, you can use the following variables:
2022-06-02 09:29:15 +00:00
| Placeholder | Templates | Description |
|:-----------------------------------------:|:--------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------:|
| `{% raw %}{{ .LinkURL }}{% endraw %}` | IdentityVerification | The URL of the used with the IdentityVerification template. |
| `{% raw %}{{ .LinkText }}{% endraw %}` | IdentityVerification | The display value for the IdentityVerification button intended for the link. |
| `{% raw %}{{ .Title }}{% endraw %}` | All | A predefined title for the email. < br > It will be `"Reset your password"` or `"Password changed successfully"` , depending on the current step |
| `{% raw %}{{ .DisplayName }}{% endraw %}` | All | The name of the user, i.e. `John Doe` |
| `{% raw %}{{ .RemoteIP }}{% endraw %}` | All | The remote IP address that initiated the request or event |
2022-04-07 03:05:20 +00:00
#### Examples
2022-04-03 12:24:51 +00:00
2022-04-07 03:05:20 +00:00
This is a basic example:
2022-04-03 12:24:51 +00:00
```html
< body >
2022-04-07 03:05:20 +00:00
< h1 > {{ .Title }}< / h1 >
Hi {{ .DisplayName }}< br / >
This email has been sent to you in order to validate your identity.
Click < a href = "{{ .LinkURL }}" > here< / a > to change your password.
2022-04-03 12:24:51 +00:00
< / body >
```
2022-06-02 09:29:15 +00:00
Some Additional examples for specific purposes can be found in the
2022-04-07 03:05:20 +00:00
[examples directory on GitHub ](https://github.com/authelia/authelia/tree/master/examples/templates/notifications ).
2022-04-03 12:24:51 +00:00
2021-04-11 11:25:03 +00:00
### filesystem
The [filesystem ](filesystem.md ) provider.
### smtp
The [smtp ](smtp.md ) provider.