feat(webhook): include requestedBy user in payload (#1385)

* feat(webhook): include requestedBy user in payload

* fix: update jsonPayload in settings.ts
This commit is contained in:
TheCatLady
2021-04-08 21:32:29 -04:00
committed by GitHub
parent d9e314bad2
commit e605687580
4 changed files with 50 additions and 14 deletions

View File

@@ -31,24 +31,29 @@ Customize the JSON payload to suit your needs. Overseerr provides several [templ
### User
These variables are usually the target user of the notification.
These variables are for the target recipient of the notification.
- `{{notifyuser_username}}` Target user's username.
- `{{notifyuser_email}}` Target user's email.
- `{{notifyuser_avatar}}` Target user's avatar.
- `{{notifyuser_settings_discordId}}` Target user's discord ID (if one is set).
- `{{notifyuser_settings_telegramChatId}}` Target user's telegram Chat ID (if one is set).
- `{{notifyuser_email}}` Target user's email address.
- `{{notifyuser_avatar}}` Target user's avatar URL.
- `{{notifyuser_settings_discordId}}` Target user's Discord ID (if one is set).
- `{{notifyuser_settings_telegramChatId}}` Target user's Telegram Chat ID (if one is set).
### Media
{% hint style="info" %}
The `notifyuser` variables are not set for the following notification types, as they are intended for application administrators rather than end users:
These variables are only included in media related notifications, such as requests.
- Media Requested
- Media Automatically Approved
- Media Failed
- `{{media_type}}` Media type. Either `movie` or `tv`.
- `{{media_tmdbid}}` Media's TMDb ID.
- `{{media_imdbid}}` Media's IMDb ID.
- `{{media_tvdbid}}` Media's TVDB ID.
- `{{media_status}}` Media's availability status (e.g., `AVAILABLE` or `PENDING`).
- `{{media_status4k}}` Media's 4K availability status (e.g., `AVAILABLE` or `PENDING`).
On the other hand, the `notifyuser` variables _will_ be replaced with the requesting user's information for the below notification types:
- Media Approved
- Media Declined
- Media Available
If you would like to use the requesting user's information in your webhook, please instead include the relevant variables from the [Request](#request) section below.
{% endhint %}
### Special
@@ -57,3 +62,25 @@ The following variables must be used as a key in the JSON payload (e.g., `"{{ext
- `{{request}}` This object will be `null` if there is no relevant request object for the notification.
- `{{media}}` This object will be `null` if there is no relevant media object for the notification.
- `{{extra}}` This object will contain the "extra" array of additional data for certain notifications.
#### Media
These `{{media}}` special variables are only included in media-related notifications, such as requests.
- `{{media_type}}` Media type. Either `movie` or `tv`.
- `{{media_tmdbid}}` Media's TMDb ID.
- `{{media_imdbid}}` Media's IMDb ID.
- `{{media_tvdbid}}` Media's TVDB ID.
- `{{media_status}}` Media's availability status (e.g., `AVAILABLE` or `PENDING`).
- `{{media_status4k}}` Media's 4K availability status (e.g., `AVAILABLE` or `PENDING`).
#### Request
The `{{request}}` special variables are only included in request-related notifications.
- `{{request_id}}` Request ID.
- `{{requestedBy_username}}` Requesting user's username.
- `{{requestedBy_email}}` Requesting user's email address.
- `{{requestedBy_avatar}}` Requesting user's avatar URL.
- `{{requestedBy_settings_discordId}}` Requesting user's Discord ID (if one is set).
- `{{requestedBy_settings_telegramChatId}}` Requesting user's Telegram Chat ID (if one is set).