mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-12-05 21:10:25 -08:00
feat: Add Messaging Service SID option for Twilio (#6347)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
@@ -25,6 +25,9 @@ class Twilio extends NotificationProvider {
|
||||
data.append("To", notification.twilioToNumber);
|
||||
data.append("From", notification.twilioFromNumber);
|
||||
data.append("Body", msg);
|
||||
if (notification.twilioMessagingServiceSID) {
|
||||
data.append("MessagingServiceSid", notification.twilioMessagingServiceSID);
|
||||
}
|
||||
|
||||
await axios.post(`https://api.twilio.com/2010-04-01/Accounts/${(notification.twilioAccountSID)}/Messages.json`, data, config);
|
||||
|
||||
|
||||
@@ -1,32 +1,37 @@
|
||||
<template>
|
||||
<div class="mb-3">
|
||||
<label for="twilio-account-sid" class="form-label">{{ $t("Account SID") }}</label>
|
||||
<label for="twilio-account-sid" class="form-label">{{ $t("twilioAccountSID") }}</label>
|
||||
<input id="twilio-account-sid" v-model="$parent.notification.twilioAccountSID" type="text" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="twilio-apikey-token" class="form-label">{{ $t("Api Key (optional)") }}</label>
|
||||
<label for="twilio-apikey-token" class="form-label">{{ $t("twilioApiKey") }}</label>
|
||||
<input id="twilio-apikey-token" v-model="$parent.notification.twilioApiKey" type="text" class="form-control">
|
||||
<div class="form-text">
|
||||
<p>
|
||||
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
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-text">{{ $t("twilioApiKeyHelptext") }}</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="twilio-auth-token" class="form-label">{{ $t("Auth Token / Api Key Secret") }}</label>
|
||||
<label for="twilio-messaging-service-sid" class="form-label">{{ $t("twilioMessagingServiceSID") }}</label>
|
||||
<input id="twilio-messaging-service-sid" v-model="$parent.notification.twilioMessagingServiceSID" type="text" class="form-control">
|
||||
<i18n-t key="twilioMessagingServiceSIDHelptext" tag="div" class="form-text">
|
||||
<template #twillo_messaging_service_help_link>
|
||||
<a href="https://help.twilio.com/articles/223134387-What-is-a-Message-SID-" target="_blank">Twilio Messaging Service</a>
|
||||
</template>
|
||||
</i18n-t>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="twilio-auth-token" class="form-label">{{ $t("twilioAuthToken") }}</label>
|
||||
<input id="twilio-auth-token" v-model="$parent.notification.twilioAuthToken" type="text" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="twilio-from-number" class="form-label">{{ $t("From Number") }}</label>
|
||||
<label for="twilio-from-number" class="form-label">{{ $t("twilioFromNumber") }}</label>
|
||||
<input id="twilio-from-number" v-model="$parent.notification.twilioFromNumber" type="text" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="twilio-to-number" class="form-label">{{ $t("To Number") }}</label>
|
||||
<label for="twilio-to-number" class="form-label">{{ $t("twilioToNumber") }}</label>
|
||||
<input id="twilio-to-number" v-model="$parent.notification.twilioToNumber" type="text" class="form-control" required>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -883,6 +883,9 @@
|
||||
"ntfyUsernameAndPassword": "Username and Password",
|
||||
"twilioAccountSID": "Account SID",
|
||||
"twilioApiKey": "Api Key (optional)",
|
||||
"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",
|
||||
"twilioMessagingServiceSID": "Messaging Service SID (optional)",
|
||||
"twilloMessagingServiceSIDHelptext": "Enter your Messaging Service SID here if using {twillo_messaging_service_help_link} to manage senders and features",
|
||||
"twilioAuthToken": "Auth Token / Api Key Secret",
|
||||
"twilioFromNumber": "From Number",
|
||||
"twilioToNumber": "To Number",
|
||||
|
||||
Reference in New Issue
Block a user