Earlier in the day, my professional colleague and friend Joydeep Chanda asked a question. His Koha v3.22.10 installation (at Gurudas College Library) had turned on SMS alert service for its users. The library being a long time Koha user, presented a challenge. He had ~ 6000+ users, so now he and his staff had the unenviable task of having to update the
smsalertnumber field in the
borrowers table for these 6000+ users. I pointed him to a recent Facebook post by another friend Vimal Kumar Vazaphally. That solved part of his problem, but he still had to choose the default types of SMS messages to be delivered.
So, I pointed him to another post by Vimal – “Use of borrowers-force-messaging-defaults script“. But after a while he complained that while the
borrowers-force-messaging-defaults script did set the SMS options, it also enabled *all* of them, he wanted SMS send option to be set only for
borrowers-force-messaging-defaults as included in its source:
If the EnhancedMessagingPreferences syspref is enabled after borrowers have been created in the DB, those borrowers won’t have messaging transport preferences default values as defined for their borrower category. So you would have to modify each borrower one by one if you would like to send them ‘Hold Filled’ notice for example.
This script create transport preferences for all existing borrowers and set them to default values defined for the category they belong to.
The answer lies in correctly assigning advanced messaging preferences by default to a patron category *and then* running the
borrowers-force-messaging-defaults script. In order for the patron category edit page display the “Default messaging preferences for this patron category” sub-form, the system preference
EnhancedMessagingPreferences needs to be enabled.
- Check if the
EnhancedMessagingPreferencesis enabled. If not, then enable it.
- Go to Home -> Administration -> Patron categories and select the category to edit.
- Scroll down the Modify category form to the “Default messaging preferences for this patron category” section.
- Select the checkboxes against the SMSes you want to be sent by default for that category.
- Save the changes
- Go to a command line terminal and run the
borrowers-force-messaging-defaultsscript. This will ensure that only the defaults are set.