Bug 36051

Summary: Add option to specify SMS::Send driver parameters in a system preference instead of a file
Product: Koha Reporter: Kyle M Hall <kyle>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall <kyle>
Status: RESOLVED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jake.deery, magnus, martin.renvoize, ryan.henderson
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36052
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/935
Text to go in the release notes:
Version(s) released in:
24.05.00
Bug Depends on:    
Bug Blocks: 37461    
Attachments: Bug 36051: Add option to specify SMS::Send driver parameters in a system preference instead of a file
Bug 36051 (QA follow-up): Use yaml_preference
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference
Bug 36051: (QA follow-up): Use yaml_preference
Bug 36051: (QA follow-up) Use IGNORE in INSERT

Description Kyle M Hall 2024-02-08 17:42:51 UTC
If an SMS::Send driver ( such as Twilio ) requires additional parameters, those parameters have to be placed in a yaml file named after the SMS::Send driver, and the path to that file specified in the Koha conf file.

It would be good if we had the option to specify those parameters in a YAML system preference instead. This would be less complicated and avoid requiring an administrator to update that data from the backend.
Comment 1 Kyle M Hall 2024-02-08 17:47:36 UTC
Created attachment 161945 [details] [review]
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference instead of a file

If an SMS::Send driver ( such as Twilio ) requires additional parameters, those parameters have to be placed in a yaml file named after the SMS::Send driver, and the path to that file specified in the Koha conf file.

It would be good if we had the option to specify those parameters in a YAML system preference instead. This would be less complicated and avoid requiring an administrator to update that data from the backend.

Test Plan:
1) Set up an SMS::Send driver that requires additional options;
   a Twilio account meets these requirements and can be created for
   free. Set this up using the traditional file based system.
2) Verify you can send SMS messages
3) Move the contents of that file into the new system preference SMSSendAdditionalOptions
4) Verify you can still send SMS messages
5) Delete the file
6) Verify yet again you can still send SMS messages!
Comment 2 Martin Renvoize 2024-02-12 17:15:27 UTC
Can we use C4::Context->yaml_preference here Kyle?
Comment 3 Kyle M Hall 2024-02-13 15:51:04 UTC
(In reply to Martin Renvoize from comment #2)
> Can we use C4::Context->yaml_preference here Kyle?

TIL! Can do!
Comment 4 Kyle M Hall 2024-02-13 16:03:05 UTC
Created attachment 162115 [details] [review]
Bug 36051 (QA follow-up): Use yaml_preference
Comment 5 Martin Renvoize 2024-02-13 16:31:33 UTC
Created attachment 162116 [details] [review]
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference

If an SMS::Send driver ( such as Twilio ) requires additional parameters, those
parameters have to be placed in a yaml file named after the SMS::Send driver,
and the path to that file specified in the Koha conf file.

It would be good if we had the option to specify those parameters in a YAML
system preference instead. This would be less complicated and avoid requiring
an administrator to update that data from the backend.

Test Plan:
1) Set up an SMS::Send driver that requires additional options;
   a Twilio account meets these requirements and can be created for
   free. Set this up using the traditional file based system.
2) Verify you can send SMS messages
3) Move the contents of that file into the new system preference
   SMSSendAdditionalOptions
4) Verify you can still send SMS messages
5) Delete the file
6) Verify yet again you can still send SMS messages!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2024-02-13 16:31:36 UTC
Created attachment 162117 [details] [review]
Bug 36051: (QA follow-up): Use yaml_preference

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2024-02-13 16:31:39 UTC
Created attachment 162118 [details] [review]
Bug 36051: (QA follow-up) Use IGNORE in INSERT

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2024-02-13 16:32:52 UTC
Simple, useful improvement. All works as expected, is resilient to mistakes and QA scripts are happy.. Going for a straight PQA here.
Comment 9 Katrin Fischer 2024-04-12 09:28:17 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-23 12:44:16 UTC
Not backported to 23.11.x