diff --git a/server/notification-providers/cellsynt.js b/server/notification-providers/cellsynt.js index ad08aacb..9032e98a 100644 --- a/server/notification-providers/cellsynt.js +++ b/server/notification-providers/cellsynt.js @@ -9,7 +9,6 @@ class Cellsynt extends NotificationProvider { */ async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; - let data = { // docs at https://www.cellsynt.com/en/sms/api-integration params: { @@ -24,7 +23,10 @@ class Cellsynt extends NotificationProvider { }; try { const resp = await axios.post("https://se-1.cellsynt.net/sms.php", null, data); - if (resp.data == null || resp.data.includes("Error")) { + if (resp.data == null ) { + throw new Error("Error: Could not connect to Cellsynt, please try again."); + } else if (resp.data.includes("Error:")) { + resp.data = resp.data.replaceAll("Error:", ""); throw new Error(resp.data); } return okMsg; diff --git a/src/components/notifications/Cellsynt.vue b/src/components/notifications/Cellsynt.vue index f212aaae..f87ebda3 100644 --- a/src/components/notifications/Cellsynt.vue +++ b/src/components/notifications/Cellsynt.vue @@ -10,17 +10,19 @@
-

{{ $t("Alpha (recommended)") }}:
{{ $t("Alphanumeric string (max 11 alphanumeric characters). Recipients can not reply to the message.") }}

-

{{ $t("Numeric") }}:
{{ $t("Numeric value (max 15 digits) with telephone number on international format without leading 00 (example UK number 07920 110 000 should be set as 447920110000). Recipients can reply to the message.") }}

+

{{ $t("Alphanumeric (recommended)") }}:
{{ $t("Alphanumeric string (max 11 alphanumeric characters). Recipients can not reply to the message.") }}

+

{{ $t("Telephone number") }}:
{{ $t("Numeric value (max 15 digits) with telephone number on international format without leading 00 (example UK number 07920 110 000 should be set as 447920110000). Recipients can reply to the message.") }}

- - + + + +

{{ $t("Visible on recipient's mobile phone as originator of the message. Allowed values and function depends on parameter originatortype.") }}

@@ -46,8 +48,12 @@ export default { HiddenInput }, mounted() { - this.$parent.notification.cellsyntOriginator = "uptime-kuma"; + if (this.$parent.notification.cellsyntOriginatortype == null || this.$parent.notification.cellsyntOriginatortype == "") { this.$parent.notification.cellsyntOriginatortype = "alpha"; + } + if (this.$parent.notification.cellsyntOriginator == null || this.$parent.notification.cellsyntOriginator == "") { + this.$parent.notification.cellsyntOriginator = "uptimekuma"; + } } }; diff --git a/src/lang/en.json b/src/lang/en.json index d1364657..3c2f4f51 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -894,8 +894,8 @@ "To Phone Number": "To Phone Number", "gtxMessagingToHint": "International format, with leading \"+\" ({e164}, {e212} or {e214})", "Originator type": "Originator type", - "Alpha (recommended)": "Alpha (recommended)", - "Numeric": "Numeric", + "Alphanumeric (recommended)": "Alphanumeric (recommended)", + "Telephone number": "Telephone number", "Alphanumeric string (max 11 alphanumeric characters). Recipients can not reply to the message.": "Alphanumeric string (max 11 alphanumeric characters). Recipients can not reply to the message.", "Numeric value (max 15 digits) with telephone number on international format without leading 00 (example UK number 07920 110 000 should be set as 447920110000). Recipients can reply to the message.": "Numeric value (max 15 digits) with telephone number on international format without leading 00 (example UK number 07920 110 000 should be set as 447920110000). Recipients can reply to the message.", "Originator": "Originator",