From eb783897dabc15d6856fdda1d1a8a51aafd14fd2 Mon Sep 17 00:00:00 2001 From: Amirparsa Baghdadi <76398455+amirparsadd@users.noreply.github.com> Date: Tue, 25 Nov 2025 03:49:07 +0330 Subject: [PATCH] fix: smsir not sending long SMSes (#6409) --- server/notification-providers/smsir.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/notification-providers/smsir.js b/server/notification-providers/smsir.js index 40e5b9cc3..850c7a933 100644 --- a/server/notification-providers/smsir.js +++ b/server/notification-providers/smsir.js @@ -32,12 +32,14 @@ class SMSIR extends NotificationProvider { return mobile; }); - const MAX_MESSAGE_LENGTH = 25; // This is a limitation placed by SMSIR + const MAX_MESSAGE_LENGTH = 20; // This is a limitation placed by SMSIR // Shorten By removing spaces, keeping context is better than cutting off the text // If that does not work, truncate. Still better than not receiving an SMS - if (msg.length > MAX_MESSAGE_LENGTH && msg.replace(/\s/g, ""). length <= MAX_MESSAGE_LENGTH) { + if (msg.length > MAX_MESSAGE_LENGTH) { msg = msg.replace(/\s/g, ""); - } else if (msg.length > MAX_MESSAGE_LENGTH) { + } + + if (msg.length > MAX_MESSAGE_LENGTH) { msg = msg.substring(0, MAX_MESSAGE_LENGTH - 1 - "...".length) + "..."; }