zhongrj
2025-11-24 276323dce9613867abb3f58a4cc2abbfb2fd0dea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{% extends "app/plugins/templates/base.html" %}
{% load i18n %}
 
{% block content %}
<h2>{% trans 'Tasks Notification' %}</h2>
<p>Get notified when a task has finished processing, has been removed or has failed</p>
<hr>
<form action="/plugins/tasknotification/" method="post" class="mt-5">
  {% csrf_token %}
  <div class="row">
    <div class="col-sm-6">
      <div class="form-group mb-3">
        <label for="notification_app_name">App name</label>
        <input name="notification_app_name" value="{{ form.notification_app_name.value }}" type="text" class="form-control" />
        {{form.notification_app_name.errors}}
      </div>
    </div>
    <div class="col-sm-6">
      <div class="form-group mb-3">
        <label for="smtp_to_address">Send Notification to Address</label>
        <input name="smtp_to_address" value="{{ form.smtp_to_address.value }}" type="text" class="form-control" placeholder="user@example.com"/>
        {{ form.smtp_to_address.errors }}
      </div>
    </div>
  </div>
  <p><b>Allowed Notifications</b></p>
  <div class="checkbox mb-3">
    <label>
      <input name="notify_task_completed" {% if form.notify_task_completed.value %} checked {% endif %} type="checkbox"> Task Completed
    </label>
    {{form.notify_task_completed.errors}}
  </div>
  <div class="checkbox mb-3">
    <label>
      <input name="notify_task_failed" {% if form.notify_task_failed.value %} checked {% endif %} type="checkbox"> Task Failed
    </label>
    {{form.notify_task_failed.errors}}
  </div>
  <div class="checkbox mb-3">
    <label>
      <input name="notify_task_removed" {% if form.notify_task_removed.value %} checked {% endif %} type="checkbox"> Task Removed
    </label>
    {{form.notify_task_removed.errors}}
  </div>
  <br>
  <h3>Smtp Settings</h3>
  <br>
  <div class="row">
    <div class="col-sm-6">
      <div class="form-group mb-3">
        <label for="smtp_from_address">From Address</label>
        <input name="smtp_from_address" value="{{ form.smtp_from_address.value }}" type="text" class="form-control" placeholder="admin@webodm.com" />
        {{ form.smtp_from_address.errors }}
      </div>
    </div>
  </div>
  <div class="form-group mb-3">
    <label for="smtp_server">SMTP Server</label>
    <input name="smtp_server" value="{{ form.smtp_server.value }}" type="text" class="form-control" placeholder="smtp.server.com" />
    {{form.smtp_server.errors}}
  </div>
  <div class="form-group mb-3">
    <label for="smtp_port">Port</label>
    <input name="smtp_port" value="{{ form.smtp_port.value }}" type="number" class="form-control" placeholder="587" />
    {{form.smtp_port.errors}}
  </div>
  <div class="form-group mb-3">
    <label for="smtp_username">Username</label>
    <input name="smtp_username" value="{{ form.smtp_username.value }}" type="text" class="form-control" />
    {{form.smtp_username.errors}}
  </div>
  <div class="form-group mb-3">
    <label for="smtp_password">Password</label>
    <input name="smtp_password" value="{{ form.smtp_password.value }}" type="password" class="form-control" />
    {{form.smtp_password.errors}}
  </div>
  <div class="checkbox mb-3">
    <label>
      <input name="smtp_use_tls" {% if form.smtp_use_tls.value %} checked {% endif %} type="checkbox"> Use Transport Layer Security (TLS)
    </label>
    {{form.smtp_use_tls.errors}}
  </div>
  <hr>
  <p>
    {{ form.non_field_errors }}
  </p>
  <div>
    <button name="apply_configuration" value="yes" class="btn btn-primary">Apply Settings</button>
    <button name="test_configuration" value="yes" class="btn btn-info">Send Test Email</button>
  </div>
</form>
{% endblock %}