Bug 18478 - Some notices sent via SMS gateway fail
authorNick Clemens <nick@bywatersolutions.com>
Wed, 17 May 2017 16:54:44 +0000 (12:54 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 29 May 2017 02:17:13 +0000 (22:17 -0400)
commit4fa3df9462eaa4a6a2399af4d7036d2f3ee990ce
treee7025cf8762cee24fd9fa74d3a45f41b79036a94
parent4f3dfd23ea12c3de64761b9e3a20e75e4e6a06c8
Bug 18478 - Some notices sent via SMS gateway fail

It seems that for HOLD and DUE (and maybe more) notices we rely on
C4::Letters::SendQueuedMessages
to populate the correct address.

This patch adjust that subroutine to correctly populate the field and/or
fail messages if no SMS provider available

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 'HOLD' letter
 3 - Set an SMS alert number for patron
 4 - Set the SMS::Send driver to 'Email'
 5 - Fill a hold for the patron
 6 - Check the db and note the address is null
 7 - run process_message_queue.pl
 8 - Check db - address is null and message pending
 9 - Apply patch
10 - run process_message_queue
11 - Message to_address should be populated and message sent

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Letters.pm