Browse code

removed a substantial number of files

DoubleBastionAdmin authored on 08/05/2023 20:27:04
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,234 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'settings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-        <div class="section">
33
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
-              or Flowroute or all of them.')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="prov_credentials" action="#" >
39
-
40
-                   <div class="providerSettings">
41
-                   <p class="providerName">Telnyx Settings</p>
42
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper right
43
-                          corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the
44
-                          'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
45
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
-
48
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
49
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
50
-                          below.):</label></p>
51
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
52
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
53
-
54
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable Messaging' 
55
-                       on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and 
56
-                       enter it in the field from below.):
57
-                   </label></p>
58
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
59
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
60
-
61
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
62
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
63
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
64
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
65
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
66
-                       the database.)</label></p>
67
-                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
68
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
69
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
70
-
71
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
72
-                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
73
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
74
-                       to save all the settings to the database.)</label></p>
75
-                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
76
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
77
-
78
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
79
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
80
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
81
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
82
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
83
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
84
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
85
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
86
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
87
-                   </div><br><br><br>
88
-
89
-                   <div class="providerSettings">
90
-                   <p class="providerName">Plivo Settings</p>
91
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
92
-                          and enter it in the field from below.):</label></p>
93
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
94
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
95
-
96
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
97
-                          enter it in the field from below.):</label></p>
98
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
99
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
100
-
101
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
102
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
103
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
104
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
105
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
106
-                       to the database.)</label></p>
107
-                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
108
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
109
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
110
-
111
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
112
-                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
113
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
114
-                       to save all the settings to the database.)</label></p>
115
-                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
116
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
117
-
118
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
119
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
120
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
121
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
122
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
123
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
124
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
125
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
126
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
127
-                   </div><br><br><br>
128
-
129
-                   <div class="providerSettings">
130
-                   <p class="providerName">Twilio Settings</p>
131
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
132
-                          and enter it in the field from below.):</label></p>
133
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
134
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
135
-
136
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
137
-                          and enter it in the field from below.):</label></p>
138
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
139
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
140
-
141
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
142
-                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
143
-                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
144
-                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
145
-                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
146
-                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
147
-                       all the settings to the database.)</label></p>
148
-                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
149
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
150
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
151
-
152
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
153
-                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
154
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
155
-                       to save all the settings to the database.)</label></p>
156
-                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
157
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
158
-
159
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
160
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
161
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
162
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
163
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
164
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
165
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
166
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
167
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
168
-                   </div><br><br><br>
169
-
170
-                   <div class="providerSettings">
171
-                   <p class="providerName">Flowroute Settings</p>
172
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
173
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
174
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
175
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
176
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
177
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
178
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
179
-
180
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
181
-                          below.):</label></p>
182
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
183
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
184
-
185
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
186
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
187
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
188
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
189
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
190
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
191
-                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
192
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
193
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
194
-
195
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
196
-                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
197
-                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
198
-                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
199
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
200
-                          Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.
201
-
202
-                   </div><br><br><br>
203
-
204
-                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
205
-                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
206
-                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
207
-
208
-                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
209
-                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
210
-
211
-                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
212
-                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
213
-                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
214
-                      Linux).</p><br>
215
-
216
-                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
217
-                      received:</b></label></p>
218
-                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
219
-                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
220
-
221
-                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
222
-                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
223
-
224
-                   <input type="hidden" id="user_id" name="user_id" />
225
-
226
-                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
227
-
228
-                   <span id="smsr_save_msg"></span>
229
-
230
-               </form>
231
-           </div>
232
-        </div>
233
-</div>
234
-
Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css lib/Service/SmsrelentlessService.php templates/settings.php

DoubleBastionAdmin authored on 01/12/2022 03:01:26
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,234 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'settings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+        <div class="section">
33
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
+              or Flowroute or all of them.')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="prov_credentials" action="#" >
39
+
40
+                   <div class="providerSettings">
41
+                   <p class="providerName">Telnyx Settings</p>
42
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper right
43
+                          corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the
44
+                          'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
45
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
+
48
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
49
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
50
+                          below.):</label></p>
51
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
52
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
53
+
54
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable Messaging' 
55
+                       on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and 
56
+                       enter it in the field from below.):
57
+                   </label></p>
58
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
59
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
60
+
61
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
62
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
63
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
64
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
65
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
66
+                       the database.)</label></p>
67
+                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
68
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
69
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
70
+
71
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
72
+                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
73
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
74
+                       to save all the settings to the database.)</label></p>
75
+                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
76
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
77
+
78
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
79
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
80
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
81
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
82
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
83
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
84
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
85
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
86
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
87
+                   </div><br><br><br>
88
+
89
+                   <div class="providerSettings">
90
+                   <p class="providerName">Plivo Settings</p>
91
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
92
+                          and enter it in the field from below.):</label></p>
93
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
94
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
95
+
96
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
97
+                          enter it in the field from below.):</label></p>
98
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
99
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
100
+
101
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
102
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
103
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
104
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
105
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
106
+                       to the database.)</label></p>
107
+                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
108
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
109
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
110
+
111
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
112
+                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
113
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
114
+                       to save all the settings to the database.)</label></p>
115
+                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
116
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
117
+
118
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
119
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
120
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
121
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
122
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
123
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
124
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
125
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
126
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
127
+                   </div><br><br><br>
128
+
129
+                   <div class="providerSettings">
130
+                   <p class="providerName">Twilio Settings</p>
131
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
132
+                          and enter it in the field from below.):</label></p>
133
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
134
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
135
+
136
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
137
+                          and enter it in the field from below.):</label></p>
138
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
139
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
140
+
141
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
142
+                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
143
+                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
144
+                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
145
+                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
146
+                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
147
+                       all the settings to the database.)</label></p>
148
+                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
149
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
150
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
151
+
152
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
153
+                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
154
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
155
+                       to save all the settings to the database.)</label></p>
156
+                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
157
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
158
+
159
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
160
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
161
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
162
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
163
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
164
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
165
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
166
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
167
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
168
+                   </div><br><br><br>
169
+
170
+                   <div class="providerSettings">
171
+                   <p class="providerName">Flowroute Settings</p>
172
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
173
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
174
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
175
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
176
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
177
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
178
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
179
+
180
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
181
+                          below.):</label></p>
182
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
183
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
184
+
185
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
186
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
187
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
188
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
189
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
190
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
191
+                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
192
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
193
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
194
+
195
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
196
+                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
197
+                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
198
+                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
199
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
200
+                          Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.
201
+
202
+                   </div><br><br><br>
203
+
204
+                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
205
+                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
206
+                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
207
+
208
+                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
209
+                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
210
+
211
+                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
212
+                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
213
+                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
214
+                      Linux).</p><br>
215
+
216
+                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
217
+                      received:</b></label></p>
218
+                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
219
+                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
220
+
221
+                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
222
+                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
223
+
224
+                   <input type="hidden" id="user_id" name="user_id" />
225
+
226
+                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
227
+
228
+                   <span id="smsr_save_msg"></span>
229
+
230
+               </form>
231
+           </div>
232
+        </div>
233
+</div>
234
+
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css lib/Service/SmsrelentlessService.php templates/settings.php

DoubleBastionAdmin authored on 01/12/2022 02:54:39
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,234 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'settings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-        <div class="section">
33
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
-              or Flowroute or all of them.')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="prov_credentials" action="#" >
39
-
40
-                   <div class="providerSettings">
41
-                   <p class="providerName">Telnyx Settings</p>
42
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper right
43
-                          corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the
44
-                          'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
45
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
-
48
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
49
-                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
50
-                          below.):</label></p>
51
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
52
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
53
-
54
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable Messaging' 
55
-                       on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and 
56
-                       enter it in the field from below.):
57
-                   </label></p>
58
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
59
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
60
-
61
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
62
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
63
-                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
64
-                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
65
-                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
66
-                       the database.)</label></p>
67
-                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
68
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
69
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
70
-
71
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
72
-                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
73
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
74
-                       to save all the settings to the database.)</label></p>
75
-                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
76
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
77
-
78
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
79
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
80
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
81
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
82
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
83
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
84
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
85
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
86
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
87
-                   </div><br><br><br>
88
-
89
-                   <div class="providerSettings">
90
-                   <p class="providerName">Plivo Settings</p>
91
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
92
-                          and enter it in the field from below.):</label></p>
93
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
94
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
95
-
96
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
97
-                          enter it in the field from below.):</label></p>
98
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
99
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
100
-
101
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
102
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
103
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
104
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
105
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
106
-                       to the database.)</label></p>
107
-                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
108
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
109
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
110
-
111
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
112
-                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
113
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
114
-                       to save all the settings to the database.)</label></p>
115
-                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
116
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
117
-
118
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
119
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
120
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
121
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
122
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
123
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
124
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
125
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
126
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
127
-                   </div><br><br><br>
128
-
129
-                   <div class="providerSettings">
130
-                   <p class="providerName">Twilio Settings</p>
131
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
132
-                          and enter it in the field from below.):</label></p>
133
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
134
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
135
-
136
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
137
-                          and enter it in the field from below.):</label></p>
138
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
139
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
140
-
141
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
142
-                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
143
-                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
144
-                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
145
-                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
146
-                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
147
-                       all the settings to the database.)</label></p>
148
-                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
149
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
150
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
151
-
152
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
153
-                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
154
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
155
-                       to save all the settings to the database.)</label></p>
156
-                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
157
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
158
-
159
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
160
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
161
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
162
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
163
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
164
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
165
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
166
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
167
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
168
-                   </div><br><br><br>
169
-
170
-                   <div class="providerSettings">
171
-                   <p class="providerName">Flowroute Settings</p>
172
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
173
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
174
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
175
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
176
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
177
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
178
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
179
-
180
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
181
-                          below.):</label></p>
182
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
183
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
184
-
185
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
186
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
187
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
188
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
189
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
190
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
191
-                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
192
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
193
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
194
-
195
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
196
-                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
197
-                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
198
-                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
199
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
200
-                          Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.
201
-
202
-                   </div><br><br><br>
203
-
204
-                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
205
-                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
206
-                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
207
-
208
-                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
209
-                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
210
-
211
-                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
212
-                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
213
-                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
214
-                      Linux).</p><br>
215
-
216
-                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
217
-                      received:</b></label></p>
218
-                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
219
-                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
220
-
221
-                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
222
-                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
223
-
224
-                   <input type="hidden" id="user_id" name="user_id" />
225
-
226
-                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
227
-
228
-                   <span id="smsr_save_msg"></span>
229
-
230
-               </form>
231
-           </div>
232
-        </div>
233
-</div>
234
-
Browse code

added lib/Migration/Version113Date20221201044315.php appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css lib/Service/SmsrelentlessService.php templates/settings.php

DoubleBastionAdmin authored on 01/12/2022 02:34:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,234 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'settings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+        <div class="section">
33
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
+              or Flowroute or all of them.')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="prov_credentials" action="#" >
39
+
40
+                   <div class="providerSettings">
41
+                   <p class="providerName">Telnyx Settings</p>
42
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, then, on the 'Home' page, in the 'API Keys' section from the upper right
43
+                          corner, click on 'Manage Keys'. If you already have an API key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the
44
+                          'Create API Key' button, on the pop up message click 'Create', then enter it in the field from below.):</label></p>
45
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
+
48
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, on the 'Home' page, in the 'API Keys' section from the 
49
+                          upper right corner, click on 'Manage Keys', then click on 'Public Key' on the upper bar, then copy the key from the 'Key' field and enter it in the field from 
50
+                          below.):</label></p>
51
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
52
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
53
+
54
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging', then on 'Programmable Messaging' 
55
+                       on the left panel, click on the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and 
56
+                       enter it in the field from below.):
57
+                   </label></p>
58
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
59
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
60
+
61
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
62
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
63
+                       below, copy it, then, in your Telnyx account click on 'Messaging' then on 'Programmable Messaging' on the left panel, click on the name of the messaging profile 
64
+                       that you associated with your phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and 
65
+                       click the 'Save' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to 
66
+                       the database.)</label></p>
67
+                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
68
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
69
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
70
+
71
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
72
+                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
73
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
74
+                       to save all the settings to the database.)</label></p>
75
+                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
76
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
77
+
78
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
79
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
80
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
81
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
82
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
83
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
84
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
85
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
86
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
87
+                   </div><br><br><br>
88
+
89
+                   <div class="providerSettings">
90
+                   <p class="providerName">Plivo Settings</p>
91
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
92
+                          and enter it in the field from below.):</label></p>
93
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
94
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
95
+
96
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
97
+                          enter it in the field from below.):</label></p>
98
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
99
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
100
+
101
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
102
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
103
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
104
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
105
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
106
+                       to the database.)</label></p>
107
+                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
108
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
109
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
110
+
111
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
112
+                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
113
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
114
+                       to save all the settings to the database.)</label></p>
115
+                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
116
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
117
+
118
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
119
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
120
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
121
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
122
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
123
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
124
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
125
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
126
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
127
+                   </div><br><br><br>
128
+
129
+                   <div class="providerSettings">
130
+                   <p class="providerName">Twilio Settings</p>
131
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
132
+                          and enter it in the field from below.):</label></p>
133
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
134
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
135
+
136
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
137
+                          and enter it in the field from below.):</label></p>
138
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
139
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
140
+
141
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
142
+                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
143
+                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
144
+                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
145
+                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
146
+                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
147
+                       all the settings to the database.)</label></p>
148
+                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
149
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
150
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
151
+
152
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
153
+                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
154
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
155
+                       to save all the settings to the database.)</label></p>
156
+                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
157
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
158
+
159
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
160
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
161
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
162
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
163
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
164
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
165
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
166
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
167
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
168
+                   </div><br><br><br>
169
+
170
+                   <div class="providerSettings">
171
+                   <p class="providerName">Flowroute Settings</p>
172
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
173
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
174
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
175
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
176
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
177
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
178
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
179
+
180
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
181
+                          below.):</label></p>
182
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
183
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
184
+
185
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
186
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
187
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
188
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
189
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
190
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
191
+                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
192
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
193
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
194
+
195
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
196
+                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
197
+                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
198
+                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
199
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
200
+                          Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.
201
+
202
+                   </div><br><br><br>
203
+
204
+                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
205
+                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
206
+                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
207
+
208
+                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
209
+                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
210
+
211
+                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
212
+                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
213
+                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
214
+                      Linux).</p><br>
215
+
216
+                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
217
+                      received:</b></label></p>
218
+                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
219
+                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
220
+
221
+                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
222
+                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
223
+
224
+                   <input type="hidden" id="user_id" name="user_id" />
225
+
226
+                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
227
+
228
+                   <span id="smsr_save_msg"></span>
229
+
230
+               </form>
231
+           </div>
232
+        </div>
233
+</div>
234
+
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt css/style.css lib/Service/SmsrelentlessService.php templates/settings.php

DoubleBastionAdmin authored on 01/12/2022 02:27:07
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,232 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'settings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-        <div class="section">
33
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
-              or Flowroute or all of them.')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="prov_credentials" action="#" >
39
-
40
-                   <div class="providerSettings">
41
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel. If you already have an API 
43
-                          key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the 'Create API Key' button, on the pop up message 
44
-                          click 'Create', then copy the key somewhere safe, then enter it in the field from below.):</label></p>
45
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
-
48
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
49
-                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
50
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
51
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
52
-
53
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
54
-                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
55
-                       below.):
56
-                   </label></p>
57
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
58
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
59
-
60
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
61
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
62
-                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
63
-                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
64
-                       to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
65
-                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
66
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
67
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
68
-
69
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
70
-                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
71
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
72
-                       to save all the settings to the database.)</label></p>
73
-                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
74
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
75
-
76
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
77
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
78
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
79
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
80
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
81
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
82
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
83
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
84
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
85
-                   </div><br><br><br>
86
-
87
-                   <div class="providerSettings">
88
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
89
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
90
-                          and enter it in the field from below.):</label></p>
91
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
92
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
93
-
94
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
95
-                          enter it in the field from below.):</label></p>
96
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
97
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
98
-
99
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
100
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
101
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
102
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
103
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
104
-                       to the database.)</label></p>
105
-                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
106
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
107
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
108
-
109
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
110
-                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
111
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
112
-                       to save all the settings to the database.)</label></p>
113
-                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
114
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
115
-
116
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
117
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
118
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
119
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
120
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
121
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
122
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
123
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
124
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
125
-                   </div><br><br><br>
126
-
127
-                   <div class="providerSettings">
128
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Twilio Settings</p>
129
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
130
-                          and enter it in the field from below.):</label></p>
131
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
132
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
133
-
134
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
135
-                          and enter it in the field from below.):</label></p>
136
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
137
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
138
-
139
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
140
-                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
141
-                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
142
-                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
143
-                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
144
-                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
145
-                       all the settings to the database.)</label></p>
146
-                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
147
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
148
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
149
-
150
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
151
-                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
152
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
153
-                       to save all the settings to the database.)</label></p>
154
-                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
155
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
156
-
157
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
158
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
159
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
160
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
161
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
162
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
163
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
164
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
165
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
166
-                   </div><br><br><br>
167
-
168
-                   <div class="providerSettings">
169
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Flowroute Settings</p>
170
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
171
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
172
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
173
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
174
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
175
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
176
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
177
-
178
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
179
-                          below.):</label></p>
180
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
181
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
182
-
183
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
184
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
185
-                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
186
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
187
-                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
188
-                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
189
-                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
190
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
191
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
192
-
193
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
194
-                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
195
-                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
196
-                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
197
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
198
-                          Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.
199
-
200
-                   </div><br><br><br>
201
-
202
-                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
203
-                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
204
-                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
205
-
206
-                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
207
-                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
208
-
209
-                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
210
-                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
211
-                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
212
-                      Linux).</p><br>
213
-
214
-                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
215
-                      received:</b></label></p>
216
-                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
217
-                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
218
-
219
-                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
220
-                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
221
-
222
-                   <input type="hidden" id="user_id" name="user_id" />
223
-
224
-                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
225
-
226
-                   <span id="smsr_save_msg"></span>
227
-
228
-               </form>
229
-           </div>
230
-        </div>
231
-</div>
232
-
Browse code

added CHANGELOG.txt appinfo/info.xml appinfo/signature.json js/settings.js templates/settings.php lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php

DoubleBastionAdmin authored on 08/09/2022 21:56:39
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,232 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'settings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+        <div class="section">
33
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
+              or Flowroute or all of them.')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="prov_credentials" action="#" >
39
+
40
+                   <div class="providerSettings">
41
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel. If you already have an API 
43
+                          key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the 'Create API Key' button, on the pop up message 
44
+                          click 'Create', then copy the key somewhere safe, then enter it in the field from below.):</label></p>
45
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
+
48
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
49
+                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
50
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
51
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
52
+
53
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
54
+                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
55
+                       below.):
56
+                   </label></p>
57
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
58
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
59
+
60
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
61
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
62
+                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
63
+                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
64
+                       to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
65
+                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
66
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
67
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
68
+
69
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
70
+                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
71
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
72
+                       to save all the settings to the database.)</label></p>
73
+                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
74
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
75
+
76
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
77
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
78
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
79
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
80
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
81
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
82
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
83
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
84
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
85
+                   </div><br><br><br>
86
+
87
+                   <div class="providerSettings">
88
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
89
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
90
+                          and enter it in the field from below.):</label></p>
91
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
92
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
93
+
94
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
95
+                          enter it in the field from below.):</label></p>
96
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
97
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
98
+
99
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
100
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
101
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
102
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
103
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
104
+                       to the database.)</label></p>
105
+                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
106
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
107
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
108
+
109
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
110
+                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
111
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
112
+                       to save all the settings to the database.)</label></p>
113
+                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
114
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
115
+
116
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
117
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
118
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
119
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
120
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
121
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
122
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
123
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
124
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
125
+                   </div><br><br><br>
126
+
127
+                   <div class="providerSettings">
128
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Twilio Settings</p>
129
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
130
+                          and enter it in the field from below.):</label></p>
131
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
132
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
133
+
134
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
135
+                          and enter it in the field from below.):</label></p>
136
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
137
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
138
+
139
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
140
+                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
141
+                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
142
+                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
143
+                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
144
+                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
145
+                       all the settings to the database.)</label></p>
146
+                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
147
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
148
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
149
+
150
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
151
+                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
152
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
153
+                       to save all the settings to the database.)</label></p>
154
+                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
155
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
156
+
157
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
158
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
159
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
160
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
161
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
162
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
163
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
164
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
165
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
166
+                   </div><br><br><br>
167
+
168
+                   <div class="providerSettings">
169
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Flowroute Settings</p>
170
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
171
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
172
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
173
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
174
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
175
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
176
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
177
+
178
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
179
+                          below.):</label></p>
180
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
181
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
182
+
183
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
184
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing 
185
+                          the button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
186
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. If you have an MMS enabled phone number, turn on the 'MMS' 
187
+                          switch, enter the same URL in the URL field and save it. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't forget to also click the 'Save' button at the 
188
+                          bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
189
+                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
190
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
191
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
192
+
193
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
194
+                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
195
+                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
196
+                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
197
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
198
+                          Flowroute only supports sending/receiving SMS/MMS messages within USA and Canada and it doesn't support Alphanumeric Sender IDs.
199
+
200
+                   </div><br><br><br>
201
+
202
+                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
203
+                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
204
+                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
205
+
206
+                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
207
+                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
208
+
209
+                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
210
+                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
211
+                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
212
+                      Linux).</p><br>
213
+
214
+                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
215
+                      received:</b></label></p>
216
+                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
217
+                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
218
+
219
+                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
220
+                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
221
+
222
+                   <input type="hidden" id="user_id" name="user_id" />
223
+
224
+                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
225
+
226
+                   <span id="smsr_save_msg"></span>
227
+
228
+               </form>
229
+           </div>
230
+        </div>
231
+</div>
232
+
Browse code

removed CHANGELOG.txt appinfo/info.xml appinfo/signature.json js/settings.js templates/settings.php lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php

DoubleBastionAdmin authored on 08/09/2022 21:52:34
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,239 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'settings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-        <div class="section">
33
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
-              or Flowroute or all of them.')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="prov_credentials" action="#" >
39
-
40
-                   <div class="providerSettings">
41
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel. If you already have an API 
43
-                          key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the 'Create API Key' button, on the pop up message 
44
-                          click 'Create', then copy the key somewhere safe, then enter it in the field from below.):</label></p>
45
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
-
48
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
49
-                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
50
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
51
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
52
-
53
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
54
-                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
55
-                       below.):
56
-                   </label></p>
57
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
58
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
59
-
60
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
61
-                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
62
-                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
63
-                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
64
-                       to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
65
-                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
66
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
67
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
68
-
69
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
70
-                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
71
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
72
-                       to save all the settings to the database.)</label></p>
73
-                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
74
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
75
-
76
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
77
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
78
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
79
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
80
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
81
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
82
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
83
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
84
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
85
-                   </div><br><br><br>
86
-
87
-                   <div class="providerSettings">
88
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
89
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
90
-                          and enter it in the field from below.):</label></p>
91
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
92
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
93
-
94
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
95
-                          enter it in the field from below.):</label></p>
96
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
97
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
98
-
99
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
100
-                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
101
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
102
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
103
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
104
-                       to the database.)</label></p>
105
-                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
106
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
107
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
108
-
109
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
110
-                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
111
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
112
-                       to save all the settings to the database.)</label></p>
113
-                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
114
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
115
-
116
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
117
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
118
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
119
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
120
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
121
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
122
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
123
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
124
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
125
-                   </div><br><br><br>
126
-
127
-                   <div class="providerSettings">
128
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Twilio Settings</p>
129
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
130
-                          and enter it in the field from below.):</label></p>
131
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
132
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
133
-
134
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
135
-                          and enter it in the field from below.):</label></p>
136
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
137
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
138
-
139
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
140
-                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
141
-                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
142
-                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
143
-                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
144
-                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
145
-                       all the settings to the database.)</label></p>
146
-                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
147
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
148
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
149
-
150
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
151
-                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
152
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
153
-                       to save all the settings to the database.)</label></p>
154
-                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
155
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
156
-
157
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
158
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
159
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
160
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
161
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
162
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
163
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
164
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
165
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
166
-                   </div><br><br><br>
167
-
168
-                   <div class="providerSettings">
169
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Flowroute Settings</p>
170
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
171
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
172
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
173
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
174
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
175
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
176
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
177
-
178
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
179
-                          below.):</label></p>
180
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
181
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
182
-
183
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
184
-                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing the 
185
-                          button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
186
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't 
187
-                          forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
188
-                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
189
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
190
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
191
-
192
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
193
-                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
194
-                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
195
-                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
196
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
197
-
198
-                   <p><label for="flow_sender_name" class="setlabeltext"><b>Flowroute alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
199
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
200
-                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
201
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
202
-                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
203
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
204
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
205
-                   <input type="text" class="smsr_textbox" id="flow_sender_name" name="flow_sender_name" autocomplete="false"
206
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
207
-                   </div><br><br><br>
208
-
209
-                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
210
-                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
211
-                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
212
-
213
-                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
214
-                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
215
-
216
-                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
217
-                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
218
-                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
219
-                      Linux).</p><br>
220
-
221
-                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
222
-                      received:</b></label></p>
223
-                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
224
-                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
225
-
226
-                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
227
-                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
228
-
229
-                   <input type="hidden" id="user_id" name="user_id" />
230
-
231
-                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
232
-
233
-                   <span id="smsr_save_msg"></span>
234
-
235
-               </form>
236
-           </div>
237
-        </div>
238
-</div>
239
-
Browse code

added README.md CHANGELOG.txt appinfo/info.xml appinfo/routes.php appinfo/signature.json css/style.css js/settings.js js/sendsms.js js/showsmstables.js lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php templates/navigation/index.php templates/content/index.php templates/settings.php js/tiff.min.js img/nextcloud_logo.svg img/nextcloud_logo_bright.svg img/sms_relentless_mms_sending.png

DoubleBastionAdmin authored on 02/09/2022 23:19:37
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,239 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'settings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+        <div class="section">
33
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS/MMS service provider you can use Telnyx or Plivo or Twilio 
35
+              or Flowroute or all of them.')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="prov_credentials" action="#" >
39
+
40
+                   <div class="providerSettings">
41
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel. If you already have an API 
43
+                          key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the 'Create API Key' button, on the pop up message 
44
+                          click 'Create', then copy the key somewhere safe, then enter it in the field from below.):</label></p>
45
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
+
48
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
49
+                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
50
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
51
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
52
+
53
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
54
+                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
55
+                       below.):
56
+                   </label></p>
57
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
58
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
59
+
60
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Telnyx
61
+                       account, so that Telnyx knows where to deliver the SMS/MMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
62
+                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
63
+                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
64
+                       to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
65
+                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
66
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
67
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
68
+
69
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
70
+                       requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
71
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
72
+                       to save all the settings to the database.)</label></p>
73
+                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
74
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
75
+
76
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
77
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
78
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
79
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
80
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
81
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
82
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
83
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
84
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
85
+                   </div><br><br><br>
86
+
87
+                   <div class="providerSettings">
88
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
89
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
90
+                          and enter it in the field from below.):</label></p>
91
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
92
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
93
+
94
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
95
+                          enter it in the field from below.):</label></p>
96
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
97
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
98
+
99
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Plivo
100
+                       account, so that Plivo knows where to deliver the SMS/MMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
101
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
102
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
103
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
104
+                       to the database.)</label></p>
105
+                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
106
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
107
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
108
+
109
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
110
+                       requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
111
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
112
+                       to save all the settings to the database.)</label></p>
113
+                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
114
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
115
+
116
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
117
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
118
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
119
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
120
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
121
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
122
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
123
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
124
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
125
+                   </div><br><br><br>
126
+
127
+                   <div class="providerSettings">
128
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Twilio Settings</p>
129
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
130
+                          and enter it in the field from below.):</label></p>
131
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
132
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
133
+
134
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
135
+                          and enter it in the field from below.):</label></p>
136
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
137
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
138
+
139
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your Twilio
140
+                       account, so that Twilio knows where to deliver the SMS/MMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
141
+                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
142
+                       for SMS/MMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
143
+                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS/MMS enabled 
144
+                       phone numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save 
145
+                       all the settings to the database.)</label></p>
146
+                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
147
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
148
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
149
+
150
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in message sending 
151
+                       requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
152
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
153
+                       to save all the settings to the database.)</label></p>
154
+                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
155
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
156
+
157
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
158
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
159
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
160
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
161
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
162
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
163
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
164
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
165
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
166
+                   </div><br><br><br>
167
+
168
+                   <div class="providerSettings">
169
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Flowroute Settings</p>
170
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
171
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
172
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
173
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
174
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
175
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
176
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
177
+
178
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
179
+                          below.):</label></p>
180
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
181
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
182
+
183
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS/MMS</b> (You have to first generate and then copy this URL into your 
184
+                          Flowroute account, so that Flowroute knows where to deliver the SMS/MMS messages received by your Flowroute phone number(s). First generate the URL by pressing the 
185
+                          button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
186
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't 
187
+                          forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
188
+                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS/MMS')) ?>" />
189
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
190
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
191
+
192
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
193
+                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
194
+                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
195
+                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
196
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
197
+
198
+                   <p><label for="flow_sender_name" class="setlabeltext"><b>Flowroute alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
199
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
200
+                          Sender IDs, such as up to 6 characters. You cannot send SMS/MMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
201
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
202
+                          preregistration of alphanumeric Sender IDs. Before sending SMS/MMS messages to a country, it's recommended to read the
203
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
204
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
205
+                   <input type="text" class="smsr_textbox" id="flow_sender_name" name="flow_sender_name" autocomplete="false"
206
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
207
+                   </div><br><br><br>
208
+
209
+                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
210
+                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
211
+                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
212
+
213
+                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS/MMS is received:</b></label></p>
214
+                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
215
+
216
+                   <p class="setlabeltext">To enable email notifications for every received SMS/MMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
217
+                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
218
+                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
219
+                      Linux).</p><br>
220
+
221
+                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS/MMS is
222
+                      received:</b></label></p>
223
+                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
224
+                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
225
+
226
+                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS/MMS message in the email notification itself:</b></label></p>
227
+                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
228
+
229
+                   <input type="hidden" id="user_id" name="user_id" />
230
+
231
+                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
232
+
233
+                   <span id="smsr_save_msg"></span>
234
+
235
+               </form>
236
+           </div>
237
+        </div>
238
+</div>
239
+
Browse code

removed README.md CHANGELOG.txt appinfo/info.xml appinfo/routes.php appinfo/signature.json css/style.css js/settings.js js/sendsms.js js/showsmstables.js lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php templates/navigation/index.php templates/content/index.php templates/settings.php

DoubleBastionAdmin authored on 02/09/2022 23:09:46
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,239 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'settings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-        <div class="section">
33
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
-           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx or Plivo or Twilio 
35
-              or Flowroute or all of them.')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="prov_credentials" action="#" >
39
-
40
-                   <div class="providerSettings">
41
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel. If you already have an API 
43
-                          key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the 'Create API Key' button, on the pop up message 
44
-                          click 'Create', then copy the key somewhere safe, then enter it in the field from below.):</label></p>
45
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
-
48
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
49
-                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
50
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
51
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
52
-
53
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
54
-                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
55
-                       below.):
56
-                   </label></p>
57
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
58
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
59
-
60
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Telnyx
61
-                       account, so that Telnyx knows where to deliver the SMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
62
-                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
63
-                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
64
-                       to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
65
-                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
66
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
67
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
68
-
69
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
70
-                       message sending requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
71
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
72
-                       to save all the settings to the database.)</label></p>
73
-                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
74
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
75
-
76
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
77
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
78
-                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
79
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
80
-                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
81
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
82
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
83
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
84
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
85
-                   </div><br><br><br>
86
-
87
-                   <div class="providerSettings">
88
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
89
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
90
-                          and enter it in the field from below.):</label></p>
91
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
92
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
93
-
94
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
95
-                          enter it in the field from below.):</label></p>
96
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
97
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
98
-
99
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Plivo
100
-                       account, so that Plivo knows where to deliver the SMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
101
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
102
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
103
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
104
-                       to the database.)</label></p>
105
-                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
106
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
107
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
108
-
109
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
110
-                       message sending requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
111
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
112
-                       to save all the settings to the database.)</label></p>
113
-                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
114
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
115
-
116
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
117
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
118
-                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
119
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
120
-                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
121
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
122
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
123
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
124
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
125
-                   </div><br><br><br>
126
-
127
-                   <div class="providerSettings">
128
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Twilio Settings</p>
129
-                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
130
-                          and enter it in the field from below.):</label></p>
131
-                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
132
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
133
-
134
-                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
135
-                          and enter it in the field from below.):</label></p>
136
-                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
137
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
138
-
139
-                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Twilio
140
-                       account, so that Twilio knows where to deliver the SMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
141
-                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
142
-                       for SMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
143
-                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS enabled phone
144
-                       numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the 
145
-                       settings to the database.)</label></p>
146
-                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
147
-                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
148
-                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
149
-
150
-                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
151
-                       message sending requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
152
-                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
153
-                       to save all the settings to the database.)</label></p>
154
-                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
155
-                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
156
-
157
-                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
158
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
159
-                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
160
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
161
-                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
162
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
163
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
164
-                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
165
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
166
-                   </div><br><br><br>
167
-
168
-                   <div class="providerSettings">
169
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Flowroute Settings</p>
170
-                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
171
-                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
172
-                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
173
-                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
174
-                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
175
-                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
176
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
177
-
178
-                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
179
-                          below.):</label></p>
180
-                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
181
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
182
-
183
-                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your 
184
-                          Flowroute account, so that Flowroute knows where to deliver the SMS messages received by your Flowroute phone number(s). First generate the URL by pressing the 
185
-                          button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
186
-                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't 
187
-                          forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
188
-                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
189
-                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
190
-                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
191
-
192
-                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
193
-                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
194
-                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
195
-                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
196
-                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
197
-
198
-                   <p><label for="flow_sender_name" class="setlabeltext"><b>Flowroute alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
199
-                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
200
-                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
201
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
202
-                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
203
-                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
204
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
205
-                   <input type="text" class="smsr_textbox" id="flow_sender_name" name="flow_sender_name" autocomplete="false"
206
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
207
-                   </div><br><br><br>
208
-
209
-                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
210
-                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
211
-                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
212
-
213
-                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS is received:</b></label></p>
214
-                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
215
-
216
-                   <p class="setlabeltext">To enable email notifications for every received SMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
217
-                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
218
-                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
219
-                      Linux).</p><br>
220
-
221
-                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS is
222
-                      received:</b></label></p>
223
-                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
224
-                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
225
-
226
-                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS message in the email notification itself:</b></label></p>
227
-                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
228
-
229
-                   <input type="hidden" id="user_id" name="user_id" />
230
-
231
-                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
232
-
233
-                   <span id="smsr_save_msg"></span>
234
-
235
-               </form>
236
-           </div>
237
-        </div>
238
-</div>
239
-
Browse code

added CHANGELOG.txt README.md appinfo/info.xml appinfo/routes.php appinfo/signature.json css/style.css js/sendsms.js js/settings.js lib/AppInfo/Application.php lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/navigation/index.php templates/settings.php lib/Migration/Version108Date20220818235106.php

DoubleBastionAdmin authored on 18/08/2022 21:30:17
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,239 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'settings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+        <div class="section">
33
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
+           <p id="settings-dscr"><h3><?php p($l->t('Enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx or Plivo or Twilio 
35
+              or Flowroute or all of them.')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="prov_credentials" action="#" >
39
+
40
+                   <div class="providerSettings">
41
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel. If you already have an API 
43
+                          key, just copy it by clicking the 'Copy to clipboard' icon. Otherwise, to create an API key, click the 'Create API Key' button, on the pop up message 
44
+                          click 'Create', then copy the key somewhere safe, then enter it in the field from below.):</label></p>
45
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
46
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
47
+
48
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
49
+                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
50
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
51
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
52
+
53
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
54
+                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
55
+                       below.):
56
+                   </label></p>
57
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
58
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
59
+
60
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Telnyx
61
+                       account, so that Telnyx knows where to deliver the SMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
62
+                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
63
+                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
64
+                       to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
65
+                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
66
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
67
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
68
+
69
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
70
+                       message sending requests, so that Telnyx knows where to send the delivery receipts. Just generate it by pressing the button from below.
71
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
72
+                       to save all the settings to the database.)</label></p>
73
+                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
74
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
75
+
76
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
77
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
78
+                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
79
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
80
+                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
81
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
82
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
83
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
84
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
85
+                   </div><br><br><br>
86
+
87
+                   <div class="providerSettings">
88
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
89
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo. On the first page, which is the Overview page, under Account, copy the 'Auth ID'
90
+                          and enter it in the field from below.):</label></p>
91
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
92
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
93
+
94
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
95
+                          enter it in the field from below.):</label></p>
96
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
97
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
98
+
99
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Plivo
100
+                       account, so that Plivo knows where to deliver the SMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
101
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
102
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
103
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings 
104
+                       to the database.)</label></p>
105
+                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
106
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
107
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
108
+
109
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
110
+                       message sending requests, so that Plivo knows where to send the delivery receipts. Just generate it by pressing the button from below.
111
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
112
+                       to save all the settings to the database.)</label></p>
113
+                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
114
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
115
+
116
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
117
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
118
+                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
119
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
120
+                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
121
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
122
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
123
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
124
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
125
+                   </div><br><br><br>
126
+
127
+                   <div class="providerSettings">
128
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Twilio Settings</p>
129
+                   <p><label for="twilapi_key" class="setlabeltext"><b>Twilio Account SID</b> (Log in to Twilio. On the first page, under Account Info, copy the 'Account SID'
130
+                          and enter it in the field from below.):</label></p>
131
+                   <input type="password" class="smsr_textbox" id="twilapi_key" name="twilapi_key" autocomplete="false"
132
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
133
+
134
+                   <p><label for="twilapi_secret" class="setlabeltext"><b>Twilio Auth Token</b> (While logged in to Twilio, on the first page, under Account Info, copy the 'Auth Token'
135
+                          and enter it in the field from below.):</label></p>
136
+                   <input type="password" class="smsr_textbox" id="twilapi_secret" name="twilapi_secret" autocomplete="false"
137
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
138
+
139
+                   <p><label for="twilapi_url_rec" class="setlabeltext"><b>Twilio webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Twilio
140
+                       account, so that Twilio knows where to deliver the SMS messages received by your Twilio phone number(s). First generate the URL by pressing the button from
141
+                       below, copy it, then, in your Twilio account click on 'Phone Numbers' on the left panel > 'Manage' > 'Active numbers', click on the phone number you want to use 
142
+                       for SMS, scroll down to the 'Messaging' section, then under 'A MESSAGE COMES IN' select 'Webhook', then paste in the webhook URL that you have just generated 
143
+                       and select 'HTTP POST' as the request type. Enter the same data under 'PRIMARY HANDLER FAILS', then click the 'Save' button. If you have multiple SMS enabled phone
144
+                       numbers, do the same for each number. Don't forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the 
145
+                       settings to the database.)</label></p>
146
+                   <input type="button" id="generate_twil_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
147
+                   <input type="text" class="smsr_textboxspec" id="twilapi_url_rec" name="twilapi_url_rec" autocomplete="false" />
148
+                   <span id="copyToClipboardtwil" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
149
+
150
+                   <p><label for="twilapi_url" class="setlabeltext"><b>Twilio webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
151
+                       message sending requests, so that Twilio knows where to send the delivery receipts. Just generate it by pressing the button from below.
152
+                       You don't have to enter this URL into your Twilio account. Don't forget to click the 'Save' button at the bottom of this page after entering all the credentials, 
153
+                       to save all the settings to the database.)</label></p>
154
+                   <input type="button" id="generate_twil_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
155
+                   <input type="text" id="twilapi_url" name="twilapi_url" autocomplete="false" /><br><br>
156
+
157
+                   <p><label for="twil_sender_name" class="setlabeltext"><b>Twilio alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
158
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
159
+                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
160
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
161
+                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
162
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
163
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
164
+                   <input type="text" class="smsr_textbox" id="twil_sender_name" name="twil_sender_name" autocomplete="false"
165
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
166
+                   </div><br><br><br>
167
+
168
+                   <div class="providerSettings">
169
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Flowroute Settings</p>
170
+                   <p><label for="flowapi_key" class="setlabeltext"><b>Flowroute Access Key</b> (Log in to Flowroute. On the left panel, click on 'Preferences', then on the 'API Control'
171
+                          tab. Scroll down to the 'API Keys' section. If you already have a pair of keys listed in that section, just copy the Access Key to the field from below. If you
172
+                          haven't created any keys yet, to create a key pair, under 'Add new API Key', in the 'Name' field, enter a name for the new key pair. In the 'Description' field 
173
+                          enter a short description, then click 'Add new'. A new pair of keys will be created and you will be prompted to copy the Secret Key. After you copy the Secret 
174
+                          Key to a safe location, copy the Access Key that has just been created to the field from below.):</label></p>
175
+                   <input type="password" class="smsr_textbox" id="flowapi_key" name="flowapi_key" autocomplete="false"
176
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
177
+
178
+                   <p><label for="flowapi_secret" class="setlabeltext"><b>Flowroute Secret Key</b> (Enter the Secret Key created earlier and copied to a safe place, in the field from 
179
+                          below.):</label></p>
180
+                   <input type="password" class="smsr_textbox" id="flowapi_secret" name="flowapi_secret" autocomplete="false"
181
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
182
+
183
+                   <p><label for="flowapi_url_rec" class="setlabeltext"><b>Flowroute webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your 
184
+                          Flowroute account, so that Flowroute knows where to deliver the SMS messages received by your Flowroute phone number(s). First generate the URL by pressing the 
185
+                          button from below, copy it, then, in your Flowroute account click on 'Preferences' on the left panel, then click on the 'API Control tab', turn on the 'SMS' 
186
+                          switch and in the field that shows up enter the URL that you have just generated. Click 'Save URL'. Also, under 'SMS Webhook Version' choose 'v2.1'. Don't 
187
+                          forget to also click the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
188
+                   <input type="button" id="generate_flow_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
189
+                   <input type="text" class="smsr_textboxspec" id="flowapi_url_rec" name="flowapi_url_rec" autocomplete="false" />
190
+                   <span id="copyToClipboardflow" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
191
+
192
+                   <p><label for="flowapi_url" class="setlabeltext"><b>Flowroute webhook URL for delivery receipts</b> (This URL is needed by Flowroute to know where to send the 
193
+                          delivery receipts. Just generate it by pressing the button from below. You don't have to enter this URL into your Flowroute account. Don't forget to click 
194
+                          the 'Save' button at the bottom of this page after entering all the credentials, to save all the settings to the database.)</label></p>
195
+                   <input type="button" id="generate_flow_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
196
+                   <input type="text" id="flowapi_url" name="flowapi_url" autocomplete="false" /><br><br>
197
+
198
+                   <p><label for="flow_sender_name" class="setlabeltext"><b>Flowroute alphanumeric Sender ID:</b> (If you intend to use an alphanumeric Sender ID, enter an alphanumeric 
199
+                          sequence of up to 11 characters in the range of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric 
200
+                          Sender IDs, such as up to 6 characters. You cannot send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
201
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
202
+                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country, it's recommended to read the
203
+                          <a href="https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID" style="color:#1b60ba" target="_blank"
204
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
205
+                   <input type="text" class="smsr_textbox" id="flow_sender_name" name="flow_sender_name" autocomplete="false"
206
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
207
+                   </div><br><br><br>
208
+
209
+                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
210
+                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
211
+                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
212
+
213
+                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS is received:</b></label></p>
214
+                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
215
+
216
+                   <p class="setlabeltext">To enable email notifications for every received SMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
217
+                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
218
+                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
219
+                      Linux).</p><br>
220
+
221
+                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS is
222
+                      received:</b></label></p>
223
+                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
224
+                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
225
+
226
+                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS message in the email notification itself:</b></label></p>
227
+                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
228
+
229
+                   <input type="hidden" id="user_id" name="user_id" />
230
+
231
+                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
232
+
233
+                   <span id="smsr_save_msg"></span>
234
+
235
+               </form>
236
+           </div>
237
+        </div>
238
+</div>
239
+
Browse code

deleted CHANGELOG.txt README.md appinfo/info.xml appinfo/routes.php appinfo/signature.json css/style.css js/sendsms.js js/settings.js lib/AppInfo/Application.php lib/Controller/AuthorApiController.php lib/Controller/SmsrelentlessController.php lib/Service/SmsrelentlessService.php templates/navigation/index.php templates/settings.php

DoubleBastionAdmin authored on 18/08/2022 21:08:00
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,155 +0,0 @@
1
-<?php
2
-/**
3
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
- *
5
- * @author Double Bastion LLC
6
- *
7
- * @license GNU AGPL version 3 or any later version
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
- * License as published by the Free Software Foundation; either
12
- * version 3 of the License, or any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public
20
- * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
- *
22
- */
23
-
24
-declare(strict_types=1);
25
-
26
-script('sms_relentless', 'settings');
27
-style('sms_relentless', 'style');
28
-
29
-?>
30
-
31
-<div id="sms_relentless_adm">
32
-        <div class="section">
33
-           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
-           <p id="settings-dscr"><h3><?php p($l->t('Please enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx or Plivo or 
35
-              both.')); ?></h3></p><br>
36
-           <div class="sms_followupsection">
37
-
38
-                <form id="prov_credentials" action="#" >
39
-
40
-                   <div class="providerSettings">
41
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
-                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel, click 'Create API Key',
43
-                          copy the Key somewhere safe, then enter it in the field from below.):</label></p>
44
-                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
45
-                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
46
-
47
-                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
48
-                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
49
-                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
50
-                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
51
-
52
-                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
53
-                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
54
-                       below.):
55
-                   </label></p>
56
-                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
57
-                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
58
-
59
-                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Telnyx
60
-                       account, so that Telnyx knows where to deliver the SMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
61
-                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
62
-                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
63
-                       to also click the 'Save' button at the bottom of this page to save all the settings to the database.)</label></p>
64
-                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
65
-                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
66
-                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
67
-
68
-                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
69
-                       message sending requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
70
-                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page to save all the
71
-                       settings to the database.)</label></p>
72
-                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
73
-                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
74
-
75
-                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (It should be an alphanumeric sequence of up to 11 characters in the range
76
-                          of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric Sender IDs, such as up to 6 characters. You cannot
77
-                          send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
78
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
79
-                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country please read the
80
-                          <a href="https://help.nexmo.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions" style="color:#1b60ba" target="_blank"
81
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
82
-                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
83
-                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
84
-                   </div><br><br><br>
85
-
86
-                   <div class="providerSettings">
87
-                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
88
-                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo; on the first page which is the Overview page, under Account, copy the 'Auth ID'
89
-                          and enter it in the field from below.):</label></p>
90
-                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
91
-                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
92
-
93
-                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
94
-                          enter it in the field from below.):</label></p>
95
-                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
96
-                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
97
-
98
-                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Plivo
99
-                       account, so that Plivo knows where to deliver the SMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
100
-                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
101
-                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
102
-                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page to save all the settings to the database.)</label></p>
103
-                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
104
-                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
105
-                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
106
-
107
-                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
108
-                       message sending requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
109
-                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page to save all the settings
110
-                       to the database.)</label></p>
111
-                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
112
-                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
113
-
114
-                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (It should be an alphanumeric sequence of up to 11 characters in the range
115
-                          of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric Sender IDs, such as up to 6 characters. You cannot
116
-                          send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
117
-                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
118
-                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country please read the
119
-                          <a href="https://help.nexmo.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions" style="color:#1b60ba" target="_blank"
120
-                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
121
-                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
122
-                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
123
-                   </div><br><br><br>
124
-
125
-                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
126
-                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
127
-                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
128
-
129
-                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS is received:</b></label></p>
130
-                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
131
-
132
-                   <p class="setlabeltext">To enable email notifications for every received SMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
133
-                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
134
-                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
135
-                      Linux).</p><br>
136
-
137
-                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS is
138
-                      received:</b></label></p>
139
-                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
140
-                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
141
-
142
-                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS message in the email notification itself:</b></label></p>
143
-                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
144
-
145
-                   <input type="hidden" id="user_id" name="user_id" />
146
-
147
-                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
148
-
149
-                   <span id="smsr_save_msg"></span>
150
-
151
-               </form>
152
-           </div>
153
-        </div>
154
-</div>
155
-
Browse code

Created repository.

DoubleBastionAdmin authored on 01/03/2022 23:47:00
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,155 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+script('sms_relentless', 'settings');
27
+style('sms_relentless', 'style');
28
+
29
+?>
30
+
31
+<div id="sms_relentless_adm">
32
+        <div class="section">
33
+           <h2><?php p($l->t('SMS Relentless'));?></h2>
34
+           <p id="settings-dscr"><h3><?php p($l->t('Please enter your credentials and options in the fields from below. As SMS service provider you can use Telnyx or Plivo or 
35
+              both.')); ?></h3></p><br>
36
+           <div class="sms_followupsection">
37
+
38
+                <form id="prov_credentials" action="#" >
39
+
40
+                   <div class="providerSettings">
41
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Telnyx Settings</p>
42
+                   <p><label for="telapi_key" class="setlabeltext"><b>Telnyx API Secret Key</b> (Log in to Telnyx, click on 'API Keys' on the left panel, click 'Create API Key',
43
+                          copy the Key somewhere safe, then enter it in the field from below.):</label></p>
44
+                   <input type="password" class="smsr_textbox" id="telapi_key" name="telapi_key" autocomplete="false"
45
+                          placeholder="<?php p($l->t('e.g. d6f172ce92e4f2 ...')); ?>" /><br>
46
+
47
+                   <p><label for="tel_pub_key" class="setlabeltext"><b>Telnyx Account Public Key</b> (While logged in to Telnyx, click on 'API Keys' on the left panel, click on 'Public
48
+                          Key' on the upper bar, then copy the public key from the 'Key' field and enter it in the field from below.):</label></p>
49
+                   <input type="password" class="smsr_textbox" id="tel_pub_key" name="tel_pub_key" autocomplete="false"
50
+                          placeholder="<?php p($l->t('e.g. KLCnMsTSp8utW3RRHx0FiXxbf5BxK2Y5q8mMTCn0jgv=')); ?>" /><br>
51
+
52
+                   <p><label for="messaging_profile_id" class="setlabeltext"><b>Messaging Profile ID</b> (While logged in to Telnyx, click on 'Messaging' on the left panel, click on 
53
+                       the name of the messaging profile that you want to use, then under 'Profile ID' you will find the messaging profile ID. Copy it and enter it in the field from 
54
+                       below.):
55
+                   </label></p>
56
+                   <input type="password" class="smsr_textbox" id="messaging_profile_id" name="messaging_profile_id" autocomplete="false"
57
+                          placeholder="<?php p($l->t('e.g. 9d4f47b6-26c9-d25c-c2f5 ...')); ?>" /><br>
58
+
59
+                   <p><label for="telapi_url_rec" class="setlabeltext"><b>Telnyx webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Telnyx
60
+                       account, so that Telnyx knows where to deliver the SMS messages received by your Telnyx phone number(s). First generate the URL by pressing the button from
61
+                       below, copy it, then, in your Telnyx account click on 'Messaging' on the left panel, click on the name of the messaging profile that you associated with your
62
+                       phone number(s), then, under 'Inbound Settings', enter the webhook URL generated here in the field 'Send a webhook to this URL' and click 'Save'. Don't forget
63
+                       to also click the 'Save' button at the bottom of this page to save all the settings to the database.)</label></p>
64
+                   <input type="button" id="generate_tel_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
65
+                   <input type="text" class="smsr_textboxspec" id="telapi_url_rec" name="telapi_url_rec" autocomplete="false" />
66
+                   <span id="copyToClipboardtel" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
67
+
68
+                   <p><label for="telapi_url" class="setlabeltext"><b>Telnyx webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
69
+                       message sending requests, so that Telnyx will know where to send the delivery receipts. Just generate it by pressing the button from below.
70
+                       You don't have to enter this URL into your Telnyx account. Don't forget to click the 'Save' button at the bottom of this page to save all the
71
+                       settings to the database.)</label></p>
72
+                   <input type="button" id="generate_tel_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
73
+                   <input type="text" id="telapi_url" name="telapi_url" autocomplete="false" /><br><br>
74
+
75
+                   <p><label for="tel_sender_name" class="setlabeltext"><b>Telnyx alphanumeric Sender ID</b> (It should be an alphanumeric sequence of up to 11 characters in the range
76
+                          of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric Sender IDs, such as up to 6 characters. You cannot
77
+                          send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
78
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
79
+                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country please read the
80
+                          <a href="https://help.nexmo.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions" style="color:#1b60ba" target="_blank"
81
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
82
+                   <input type="text" class="smsr_textbox" id="tel_sender_name" name="tel_sender_name" autocomplete="false"
83
+                          placeholder="<?php p($l->t('e.g. Smart Inc')); ?>" />
84
+                   </div><br><br><br>
85
+
86
+                   <div class="providerSettings">
87
+                   <p style="font-size:18px;font-weight:bold;margin-bottom:20px;">Plivo Settings</p>
88
+                   <p><label for="nexapi_key" class="setlabeltext"><b>Plivo Auth ID</b> (Log in to Plivo; on the first page which is the Overview page, under Account, copy the 'Auth ID'
89
+                          and enter it in the field from below.):</label></p>
90
+                   <input type="password" class="smsr_textbox" id="nexapi_key" name="nexapi_key" autocomplete="false"
91
+                          placeholder="<?php p($l->t('e.g. r5g974cb92e4t1 ...')); ?>" /><br>
92
+
93
+                   <p><label for="nexapi_secret" class="setlabeltext"><b>Plivo Auth Token</b> (While logged in to Plivo, on the Overview page, under Account, copy the 'Auth Token' and
94
+                          enter it in the field from below.):</label></p>
95
+                   <input type="password" class="smsr_textbox" id="nexapi_secret" name="nexapi_secret" autocomplete="false"
96
+                          placeholder="<?php p($l->t('e.g. k6f489d8awn4p9 ...')); ?>" /><br>
97
+
98
+                   <p><label for="nexapi_url_rec" class="setlabeltext"><b>Plivo webhook URL for incoming SMS</b> (You have to first generate and then copy this URL into your Plivo
99
+                       account, so that Plivo knows where to deliver the SMS messages received by your Plivo phone number(s). First generate the URL by pressing the button from
100
+                       below, copy it, then, in your Plivo account click on 'Messaging' on the left vertical bar, click on 'Applications', then, under 'Application name' click on
101
+                       'Inbound SMS Messages', next, under 'Message', enter the webhook URL generated here in the field 'Message URL' and select 'POST' next to it, then click the
102
+                       'Update Application' button. Don't forget to also click the 'Save' button at the bottom of this page to save all the settings to the database.)</label></p>
103
+                   <input type="button" id="generate_nex_rcpt" value="<?php p($l->t('Generate new webhook URL for incoming SMS')) ?>" />
104
+                   <input type="text" class="smsr_textboxspec" id="nexapi_url_rec" name="nexapi_url_rec" autocomplete="false" />
105
+                   <span id="copyToClipboardnex" class="icon icon-clippy" title="Copy to clipboard"></span><br><br>
106
+
107
+                   <p><label for="nexapi_url" class="setlabeltext"><b>Plivo webhook URL for delivery receipts</b> (This URL will be included by SMS Relentless in SMS
108
+                       message sending requests, so that Plivo will know where to send the delivery receipts. Just generate it by pressing the button from below.
109
+                       You don't have to enter this URL into your Plivo account. Don't forget to click the 'Save' button at the bottom of this page to save all the settings
110
+                       to the database.)</label></p>
111
+                   <input type="button" id="generate_nex_delrcpt" value="<?php p($l->t('Generate new webhook URL for delivery receipts')) ?>" />
112
+                   <input type="text" id="nexapi_url" name="nexapi_url" autocomplete="false" /><br><br>
113
+
114
+                   <p><label for="nex_sender_name" class="setlabeltext"><b>Plivo alphanumeric Sender ID:</b> (It should be an alphanumeric sequence of up to 11 characters in the range
115
+                          of a-z, A-Z, 0-9 and space. In certain countries there are regulations that accept only shorter alphanumeric Sender IDs, such as up to 6 characters. You cannot
116
+                          send SMS messages with alphanumeric Sender IDs to USA or Canada. There are even 
117
+                          <a href="https://support.plivo.com/hc/en-us/articles/360041448032" style="color:#1b60ba" target="_blank" rel="noreferrer noopener">countries</a> that require
118
+                          preregistration of alphanumeric Sender IDs. Before sending SMS messages to a country please read the
119
+                          <a href="https://help.nexmo.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions" style="color:#1b60ba" target="_blank"
120
+                          rel="noreferrer noopener">country specific features and restrictions.</a> Some carriers won't accept messages with an alphanumeric Sender ID): </label></p>
121
+                   <input type="text" class="smsr_textbox" id="nex_sender_name" name="nex_sender_name" autocomplete="false"
122
+                          placeholder="<?php p($l->t('e.g. Global Inc')); ?>" />
123
+                   </div><br><br><br>
124
+
125
+                   <p><label for="messagesperpage" class="setlabeltext"><b>Number of messages per page</b> (Enter the number of messages to be displayed on one page of the
126
+                          received and sent messages tables. If you don't enter anything in this field, the default of 100 messages per page will be used.):</label></p>
127
+                   <input type="number" class="smsr_textbox" id="messagesperpage" name="messagesperpage" autocomplete="false" placeholder="<?php p($l->t('e.g. 100')); ?>"/><br>
128
+
129
+                   <p><label for="get_notify" class="setlabeltext"><b>I want to see a notification in Nextcloud when a new SMS is received:</b></label></p>
130
+                   <input type="checkbox" class="sms_rel_checkbox" id="get_notify" name="get_notify" autocomplete="false" /><br>
131
+
132
+                   <p class="setlabeltext">To enable email notifications for every received SMS, the "sendmail" utility ("/usr/sbin/sendmail" on Debian Linux),
133
+                      has to be present on the server. "sendmail" is a binary which gets installed when Postfix is installed. Also the server user (www-data) has to be
134
+                      allowed to send emails from command line (by specifying "authorized_submit_users = www-data" in "/etc/postfix/main.cf" for Postfix on a Debian based
135
+                      Linux).</p><br>
136
+
137
+                   <p><label for="notification_email" class="setlabeltext"><b>I want to receive a notification to the email address from below, when a new SMS is
138
+                      received:</b></label></p>
139
+                   <input type="text" class="smsr_textbox" id="notification_email" name="notification_email" autocomplete="false"
140
+                          placeholder="<?php p($l->t('e.g. john.doe@example.com')); ?>" /><br>
141
+
142
+                   <p><label for="includesmsinemail" class="setlabeltext"><b>Include the SMS message in the email notification itself:</b></label></p>
143
+                   <input type="checkbox" class="sms_rel_checkbox" id="includesmsinemail" name="includesmsinemail" autocomplete="false" /><br>
144
+
145
+                   <input type="hidden" id="user_id" name="user_id" />
146
+
147
+                   <input id="save_sms_settings" type="submit" value="<?php p($l->t('Save')) ?>" />
148
+
149
+                   <span id="smsr_save_msg"></span>
150
+
151
+               </form>
152
+           </div>
153
+        </div>
154
+</div>
155
+