You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
10 KiB
132 lines
10 KiB
3 years ago
|
|
||
8 months ago
|
{% from '_helpers.html' import render_field %}
|
||
3 years ago
|
|
||
2 years ago
|
{% macro render_common_settings_form(form, emailprefix, settings_application) %}
|
||
3 years ago
|
<div class="pure-control-group">
|
||
|
{{ render_field(form.notification_urls, rows=5, placeholder="Examples:
|
||
|
Gitter - gitter://token/room
|
||
|
Office365 - o365://TenantID:AccountEmail/ClientID/ClientSecret/TargetEmail
|
||
|
AWS SNS - sns://AccessKeyID/AccessSecretKey/RegionName/+PhoneNo
|
||
2 years ago
|
SMTPS - mailtos://user:pass@mail.domain.com?to=receivingAddress@example.com",
|
||
|
class="notification-urls" )
|
||
3 years ago
|
}}
|
||
3 years ago
|
<div class="pure-form-message-inline">
|
||
|
<ul>
|
||
|
<li>Use <a target=_new href="https://github.com/caronc/apprise">AppRise URLs</a> for notification to just about any service! <i><a target=_new href="https://github.com/dgtlmoon/changedetection.io/wiki/Notification-configuration-notes">Please read the notification services wiki here for important configuration notes</a></i>.</li>
|
||
1 year ago
|
<li><code><a target=_new href="https://github.com/caronc/apprise/wiki/Notify_discord">discord://</a></code> (or <code>https://discord.com/api/webhooks...</code>)) only supports a maximum <strong>2,000 characters</strong> of notification text, including the title.</li>
|
||
1 year ago
|
<li><code><a target=_new href="https://github.com/caronc/apprise/wiki/Notify_telegram">tgram://</a></code> bots can't send messages to other bots, so you should specify chat ID of non-bot user.</li>
|
||
1 year ago
|
<li><code><a target=_new href="https://github.com/caronc/apprise/wiki/Notify_telegram">tgram://</a></code> only supports very limited HTML and can fail when extra tags are sent, <a href="https://core.telegram.org/bots/api#html-style">read more here</a> (or use plaintext/markdown format)</li>
|
||
1 year ago
|
<li><code>gets://</code>, <code>posts://</code>, <code>puts://</code>, <code>deletes://</code> for direct API calls (or omit the "<code>s</code>" for non-SSL ie <code>get://</code>) <a href="https://github.com/dgtlmoon/changedetection.io/wiki/Notification-configuration-notes#postposts">more help here</a></li>
|
||
2 years ago
|
<li>Accepts the <code>{{ '{{token}}' }}</code> placeholders listed below</li>
|
||
3 years ago
|
</ul>
|
||
3 years ago
|
</div>
|
||
2 years ago
|
<div class="notifications-wrapper">
|
||
2 years ago
|
<a id="send-test-notification" class="pure-button button-secondary button-xsmall" >Send test notification</a>
|
||
2 years ago
|
{% if emailprefix %}
|
||
2 years ago
|
<a id="add-email-helper" class="pure-button button-secondary button-xsmall" >Add email <img style="height: 1em; display: inline-block" src="{{url_for('static_content', group='images', filename='email.svg')}}" alt="Add an email address"> </a>
|
||
2 years ago
|
{% endif %}
|
||
2 years ago
|
<a href="{{url_for('notification_logs')}}" class="pure-button button-secondary button-xsmall" >Notification debug logs</a>
|
||
2 years ago
|
</div>
|
||
3 years ago
|
</div>
|
||
3 years ago
|
<div id="notification-customisation" class="pure-control-group">
|
||
3 years ago
|
<div class="pure-control-group">
|
||
2 years ago
|
{{ render_field(form.notification_title, class="m-d notification-title", placeholder=settings_application['notification_title']) }}
|
||
3 years ago
|
<span class="pure-form-message-inline">Title for all notifications</span>
|
||
|
</div>
|
||
|
<div class="pure-control-group">
|
||
2 years ago
|
{{ render_field(form.notification_body , rows=5, class="notification-body", placeholder=settings_application['notification_body']) }}
|
||
1 year ago
|
<span class="pure-form-message-inline">Body for all notifications ‐ You can use <a target="_new" href="https://jinja.palletsprojects.com/en/3.0.x/templates/">Jinja2</a> templating in the notification title, body and URL, and tokens from below.
|
||
|
</span>
|
||
|
|
||
|
</div>
|
||
|
<div class="pure-controls">
|
||
|
<div id="notification-token-toggle" class="pure-button button-tag button-xsmall">Show token/placeholders</div>
|
||
3 years ago
|
</div>
|
||
1 year ago
|
<div class="pure-controls" style="display: none;" id="notification-tokens-info">
|
||
3 years ago
|
<table class="pure-table" id="token-table">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Token</th>
|
||
|
<th>Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{base_url}}' }}</code></td>
|
||
3 years ago
|
<td>The URL of the changedetection.io instance you are running.</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{watch_url}}' }}</code></td>
|
||
3 years ago
|
<td>The URL being watched.</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{watch_uuid}}' }}</code></td>
|
||
3 years ago
|
<td>The UUID of the watch.</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{watch_title}}' }}</code></td>
|
||
3 years ago
|
<td>The title of the watch.</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{watch_tag}}' }}</code></td>
|
||
2 years ago
|
<td>The watch label / tag</td>
|
||
3 years ago
|
</tr>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{preview_url}}' }}</code></td>
|
||
3 years ago
|
<td>The URL of the preview page generated by changedetection.io.</td>
|
||
|
</tr>
|
||
3 years ago
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{diff_url}}' }}</code></td>
|
||
|
<td>The URL of the diff output for the watch.</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><code>{{ '{{diff}}' }}</code></td>
|
||
|
<td>The diff output - only changes, additions, and removals</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><code>{{ '{{diff_added}}' }}</code></td>
|
||
|
<td>The diff output - only changes and additions</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><code>{{ '{{diff_removed}}' }}</code></td>
|
||
|
<td>The diff output - only changes and removals</td>
|
||
3 years ago
|
</tr>
|
||
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{diff_full}}' }}</code></td>
|
||
3 years ago
|
<td>The diff output - full difference output</td>
|
||
|
</tr>
|
||
1 year ago
|
<tr>
|
||
|
<td><code>{{ '{{diff_patch}}' }}</code></td>
|
||
|
<td>The diff output - patch in unified format</td>
|
||
|
</tr>
|
||
3 years ago
|
<tr>
|
||
2 years ago
|
<td><code>{{ '{{current_snapshot}}' }}</code></td>
|
||
1 year ago
|
<td>The current snapshot text contents value, useful when combined with JSON or CSS filters
|
||
3 years ago
|
</td>
|
||
|
</tr>
|
||
2 years ago
|
<tr>
|
||
|
<td><code>{{ '{{triggered_text}}' }}</code></td>
|
||
|
<td>Text that tripped the trigger from filters</td>
|
||
|
</tr>
|
||
3 years ago
|
</tbody>
|
||
|
</table>
|
||
2 years ago
|
<div class="pure-form-message-inline">
|
||
1 year ago
|
<p>
|
||
|
Warning: Contents of <code>{{ '{{diff}}' }}</code>, <code>{{ '{{diff_removed}}' }}</code>, and <code>{{ '{{diff_added}}' }}</code> depend on how the difference algorithm perceives the change. <br>
|
||
|
For example, an addition or removal could be perceived as a change in some cases. <a target="_new" href="https://github.com/dgtlmoon/changedetection.io/wiki/Using-the-%7B%7Bdiff%7D%7D,-%7B%7Bdiff_added%7D%7D,-and-%7B%7Bdiff_removed%7D%7D-notification-tokens">More Here</a> <br>
|
||
|
</p>
|
||
11 months ago
|
<p>
|
||
|
For JSON payloads, use <strong>|tojson</strong> without quotes for automatic escaping, for example - <code>{ "name": {{ '{{ watch_title|tojson }}' }} }</code>
|
||
|
</p>
|
||
11 months ago
|
<p>
|
||
|
URL encoding, use <strong>|urlencode</strong>, for example - <code>gets://hook-website.com/test.php?title={{ '{{ watch_title|urlencode }}' }}</code>
|
||
|
</p>
|
||
2 years ago
|
</div>
|
||
3 years ago
|
</div>
|
||
1 year ago
|
<div class="pure-control-group">
|
||
|
{{ render_field(form.notification_format , class="notification-format") }}
|
||
|
<span class="pure-form-message-inline">Format for all notifications</span>
|
||
|
</div>
|
||
3 years ago
|
</div>
|
||
3 years ago
|
{% endmacro %}
|