Bug 35639 - Long SMS messages are not sent if they exceed the character limitation of the messaging driver
Summary: Long SMS messages are not sent if they exceed the character limitation of the...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-22 13:19 UTC by Emily-Rose Francoeur
Modified: 2024-11-18 16:25 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 35639: Trim the messages that are too long before sending them via SMS (6.25 KB, patch)
2023-12-22 13:58 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 35639: Trim the messages that are too long before sending them via SMS (6.33 KB, patch)
2024-01-09 09:48 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 35639: Trim the messages that are too long before sending them via SMS (6.85 KB, patch)
2024-04-05 15:58 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 35639: Trim the messages that are too long before sending them via SMS (6.87 KB, patch)
2024-05-17 12:02 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emily-Rose Francoeur 2023-12-22 13:19:21 UTC
Some messages that were supposed to be sent via SMS are not delivered because SMS has a character limitation. Since this limitation also depends on the driver used with SMS::Send, it would be good to have a system preference to choose the message length. This way, even messages that are too long could still be sent (but they would be cut).

Example with a limitation of 120 characters:

“According to our records, you have at least one item that is overdue.
The following item(s) are overdue:
- Book 1
- Book 2
- Book 3“

will become :

“According to our records, you have at least one item that is overdue.
The following item(s) are overdue:
- Book 1
- Book...“
Comment 1 Emily-Rose Francoeur 2023-12-22 13:58:24 UTC
Created attachment 160243 [details] [review]
Bug 35639: Trim the messages that are too long before sending them via SMS

I created a new system preference, SMSSendMaxChar, which allows you to set a limit for the number of characters in SMS messages to send. When a limit is set, messages that exceed it will be trimed.

TEST PLAN
1) Apply the patch
2) Run prove t/db_dependent/Letters.t
Comment 2 Matt Blenkinsop 2024-01-09 09:48:15 UTC
Created attachment 160684 [details] [review]
Bug 35639: Trim the messages that are too long before sending them via SMS

I created a new system preference, SMSSendMaxChar, which allows you to set a limit for the number of characters in SMS messages to send. When a limit is set, messages that exceed it will be trimed.

TEST PLAN
1) Apply the patch
2) Run prove t/db_dependent/Letters.t

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 3 Matthias Le Gac 2024-04-05 15:58:39 UTC
Created attachment 164486 [details] [review]
Bug 35639: Trim the messages that are too long before sending them via SMS

I created a new system preference, SMSSendMaxChar, which allows you to set a limit for the number of characters in SMS messages to send. When a limit is set, messages that exceed it will be trimed.

TEST PLAN
1) Apply the patch
2) Run prove t/db_dependent/Letters.t
Comment 4 Kyle M Hall (khall) 2024-05-17 12:02:18 UTC
Created attachment 166887 [details] [review]
Bug 35639: Trim the messages that are too long before sending them via SMS

I created a new system preference, SMSSendMaxChar, which allows you to set a limit for the number of characters in SMS messages to send. When a limit is set, messages that exceed it will be trimed.

TEST PLAN
1) Apply the patch
2) Run prove t/db_dependent/Letters.t

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall (khall) 2024-05-17 12:03:55 UTC
Would it not be more effective to split the message into chunks of SMSSendMaxChar characters and send multiple messages at the time of sending, rather than truncating the message at the time it is enqueued?
Comment 6 Caroline Cyr La Rose 2024-05-17 13:01:50 UTC
It would cost more for the libraries though, since SMS are usually an amount per message sent, no?
Comment 7 Katrin Fischer 2024-05-17 18:44:51 UTC
(In reply to Caroline Cyr La Rose from comment #6)
> It would cost more for the libraries though, since SMS are usually an amount
> per message sent, no?

I think that's correct.
Comment 8 Kyle M Hall (khall) 2024-05-23 15:12:34 UTC
(In reply to Katrin Fischer from comment #7)
> (In reply to Caroline Cyr La Rose from comment #6)
> > It would cost more for the libraries though, since SMS are usually an amount
> > per message sent, no?
> 
> I think that's correct.

Sounds reasonable. Thanks for the feedback!
Comment 9 Martin Renvoize (ashimema) 2024-05-25 05:47:19 UTC
Could we somehow highlight to the template author the need to reduce character counts in SMS notice templates too?
Comment 10 Martin Renvoize (ashimema) 2024-06-11 10:56:12 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant