Bug 18990 - Overdue Notices are not sending through SMS correctly
Summary: Overdue Notices are not sending through SMS correctly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 18478
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-27 13:03 UTC by Kelly McElligott
Modified: 2019-10-14 19:57 UTC (History)
2 users (show)

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


Attachments
Bug 18990 - Overdue Notices are not sending through SMS correctly (3.99 KB, patch)
2017-07-28 12:04 UTC, Nick Clemens
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18990 - Overdue Notices are not sending through SMS correctly (4.05 KB, patch)
2017-08-22 10:05 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18990 - Overdue Notices are not sending through SMS correctly (4.08 KB, patch)
2017-10-06 10:11 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18990 - Overdue Notices are not sending through SMS correctly (4.18 KB, patch)
2017-11-10 12:45 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly McElligott 2017-07-27 13:03:17 UTC
For SMS messages to be sent, the patron has to have a phone number to receive text messages and their carrier.  When an enhanced message sends(advance notices, holds, checkin, checkouts)  it takes the phone number and adds the appropriate carrier information to it.  For the Over Notices, the SMS number is not getting attached to the carrier information, the email information is being used instead.  Thus the patron is receiving an SMS overdue notice via their email address instead of through a text message. 


See below- an advanced notice of Item due sent via SMS uses the phone number, however, the overdue Notice uses the email address: 


select message_id, to_address, subject, message_transport_type as mtt from message_queue where message_transport_type='sms' and date(time_queued) = CURRENT_DATE limit 10;
+------------+------------------------------------------------------+----------------------------+-----+
| message_id | to_address | subject | mtt |
+------------+------------------------------------------------------+----------------------------+-----+
| 549913 | cabs@gmail.com@vtext.com@vtext.com@vtext.com | Overdue Notice | sms |
| 551808 | llie.re@btx.gov@txt.att.net | Overdue Notice | sms |
| 551811 | nbur5@tx.rr.com@tmomail.net | Overdue Notice | sms |
| 551814 | jbeel@gmail.com@vtext.com | Overdue Notice | sms |
| 551871 | 8172284361@tmomail.net | Advance Notice of Item Due | sms |
| 551873 | 8172284361@tmomail.net | Advance Notice of Item Due | sms |
| 551875 | 8172284361@tmomail.net | Advance Notice of Item Due | sms |
| 551901 | 817-879-8111@txt.att.net | Advance Notice of Item Due | sms |
| 551904 | 817-879-8111@txt.att.net | Advance Notice of Item Due | sms |
| 551906 | 817-879-8111@txt.att.net | Advance Notice of Item Due | sms |
+------------+------------------------------------------------------+----------------------------+-----+
Comment 1 Nick Clemens 2017-07-28 12:04:04 UTC
Created attachment 65312 [details] [review]
Bug 18990 - Overdue Notices are not sending through SMS correctly

Bug 18478 fixed sms via email problems under the assumption that
to_address was either smsalertnumber or blank.

It seems overdues set the to_address to email. This patch changes the
code to enforce that an sms sent with emial driver will use the
smsalertnumebr and provider defined for the borrower, regardless of what
is set in the queue

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
  SMS
 2 - Ensure you have defined an SMS message for an overdue letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Checkout an item as overdue to trigger notice above
 6 - Run overdue_notices.pl
 6 - Check the db and note the address is email
 7 - run process_message_queue.pl
 8 - Check db - address is email followed by service provider
 9 - Apply patch
 10 - repeat
 11 - Message to_address should be populated with smsalertnumber
Comment 2 Josef Moravec 2017-08-22 10:05:42 UTC
Created attachment 66308 [details] [review]
[SIGNED-OFF] Bug 18990 - Overdue Notices are not sending through SMS correctly

Bug 18478 fixed sms via email problems under the assumption that
to_address was either smsalertnumber or blank.

It seems overdues set the to_address to email. This patch changes the
code to enforce that an sms sent with emial driver will use the
smsalertnumebr and provider defined for the borrower, regardless of what
is set in the queue

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
  SMS
 2 - Ensure you have defined an SMS message for an overdue letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Checkout an item as overdue to trigger notice above
 6 - Run overdue_notices.pl
 6 - Check the db and note the address is email
 7 - run process_message_queue.pl
 8 - Check db - address is email followed by service provider
 9 - Apply patch
 10 - repeat
 11 - Message to_address should be populated with smsalertnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 3 Nick Clemens 2017-10-06 10:11:30 UTC
Created attachment 67686 [details] [review]
Bug 18990 - Overdue Notices are not sending through SMS correctly

Bug 18478 fixed sms via email problems under the assumption that
to_address was either smsalertnumber or blank.

It seems overdues set the to_address to email. This patch changes the
code to enforce that an sms sent with emial driver will use the
smsalertnumebr and provider defined for the borrower, regardless of what
is set in the queue

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
  SMS
 2 - Ensure you have defined an SMS message for an overdue letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Checkout an item as overdue to trigger notice above
 6 - Run overdue_notices.pl
 6 - Check the db and note the address is email
 7 - run process_message_queue.pl
 8 - Check db - address is email followed by service provider
 9 - Apply patch
 10 - repeat
 11 - Message to_address should be populated with smsalertnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Marcel de Rooy 2017-11-10 12:45:15 UTC
Created attachment 69080 [details] [review]
Bug 18990 - Overdue Notices are not sending through SMS correctly

Bug 18478 fixed sms via email problems under the assumption that
to_address was either smsalertnumber or blank.

It seems overdues set the to_address to email. This patch changes the
code to enforce that an sms sent with emial driver will use the
smsalertnumebr and provider defined for the borrower, regardless of what
is set in the queue

To test:
 1 - Define a messaging prefs for a patron to recieve hold notices via
  SMS
 2 - Ensure you have defined an SMS message for an overdue letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Checkout an item as overdue to trigger notice above
 6 - Run overdue_notices.pl
 6 - Check the db and note the address is email
 7 - run process_message_queue.pl
 8 - Check db - address is email followed by service provider
 9 - Apply patch
 10 - repeat
 11 - Message to_address should be populated with smsalertnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Jonathan Druart 2017-12-07 12:39:46 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 6 Nick Clemens 2017-12-14 12:32:05 UTC
Pushed to stable for 17.11.01, awesome work all!
Comment 7 Fridolin Somers 2017-12-20 11:07:39 UTC
Pushed to 17.05.x, will be in v17.05.07

Just had to change $patron->smsalertnumber into $member->{'smsalertnumber'}