Skip to content

Commit dbcfbf8

Browse files
committed
Adds support for ntfy's phone call feature
Sends X-Call header with either `yes` or a specific number. These numbers need to be validated in the ntfy dashboard before they can be used. Note: This feature is only available for Supporter+
1 parent d053039 commit dbcfbf8

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

server/notification-providers/ntfy.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ class Ntfy extends NotificationProvider {
2222
"Authorization": "Bearer " + notification.ntfyaccesstoken,
2323
};
2424
}
25-
let config = { headers };
25+
if (notification.ntfyCall) {
26+
headers["X-Call"] = notification.ntfyCall;
27+
}
28+
let config = {
29+
headers,
30+
};
2631
config = this.getAxiosConfigWithProxy(config);
2732
// If heartbeatJSON is null, assume non monitoring notification (Certificate warning) or testing.
2833
if (heartbeatJSON == null) {

src/components/notifications/Ntfy.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
<label for="ntfy-icon" class="form-label">{{ $t("IconUrl") }}</label>
5353
<input id="ntfy-icon" v-model="$parent.notification.ntfyIcon" type="text" class="form-control">
5454
</div>
55+
<div class="mb-3">
56+
<label for="ntfy-call" class="form-label">{{ $t("ntfyCall") }}</label>
57+
<input id="ntfy-call" v-model="$parent.notification.ntfyCall" type="text" class="form-control" placeholder="yes or +12223334444">
58+
<div class="form-text">
59+
{{ $t("ntfyCallHelptext") }}
60+
</div>
61+
</div>
5562
</template>
5663

5764
<script>

src/lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,8 @@
913913
"ntfyPriorityHelptextPriorityHigherThanDown": "Regular priority should be higher than {0} priority. Priority {1} is higher than {0} priority {2}",
914914
"ntfyPriorityDown": "Priority for DOWN-events",
915915
"ntfyUsernameAndPassword": "Username and Password",
916+
"ntfyCall": "Phone Call",
917+
"ntfyCallHelptext": "Make a phone call when alert fires. Set to 'yes' to use your first verified number, or enter a specific phone number (e.g. +12223334444). Requires ntfy Pro and a verified phone number.",
916918
"twilioAccountSID": "Account SID",
917919
"twilioApiKey": "Api Key (optional)",
918920
"twilioApiKeyHelptext": "The API key is optional but recommended. You can provide either Account SID and AuthToken from the may TwilioConsole page or Account SID and the pair of Api Key and Api Key secret",

0 commit comments

Comments
 (0)