Bug 10833: Multi transport types for advanced notices
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 6 Sep 2013 09:39:51 +0000 (11:39 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 2 May 2014 20:29:20 +0000 (20:29 +0000)
commit76dde86fcea815565399cb3d6ac4ed3a653ba60a
treeb10b181904f1201dcb970c2ab2674344332cb337
parentca052b2558629052574c4a66425e9e6268392ca8
Bug 10833: Multi transport types for advanced notices

Test plan:
- Choose 2 patrons P1 and P2
- Edit "Patron messaging preferences" and
check SMS + email with 2 days in advance for P1
check email with 5 days in advance for P2
- defined a message for the letter code PREDUE for sms and email
  (tools/letters.pl).
- select 2 barcodes (B1, B2).
    * checkout B1 to P1 with a due date = NOW - 2 days
    * checkout B2 to P2 with a due date = NOW - 5 days
- into the mysql cli, note the value of unsent message:
  select count(*) from message_queue where status != "send";
- launch the cronjob:
  perl misc/cronjobs/advance_notices.pl -c
- retry the previous sql query, you should have X + 3 unsent messages
  (depending of current checkouts in your DB!).
- view all unsent message:
  select borrowernumber, letter_code, message_transport_type, content
  from message_queue where status != "send";
  You should see:
    2 messages for P1, 1 for sms, 1 for email and the letter code PREDUE
    1 message for P2, email and the letter code PREDUE

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
misc/cronjobs/advance_notices.pl