Message transport types

From Koha Wiki

Jump to: navigation, search
Koha > Technical > Development > RFCs



Currently one cannot define separate templates for different message delivery methods. There is only one default template, which is mainly used for email. This is problematic since some patrons don't have an email, or sms, or a print address. How do you contact such patrons? It is not smart to send email via sms, nor sms via printed letters.

Make it possible to define a template for each message transport type (email, sms, print, ...) in use for each letter. So our users can flexibly change the desired delivery method, and get meaningful messages delivered. It also enables librarians to claim overdues more flexibly, and with a larger impact.

This upgrade is done seamlessly by updating all existing letters under the email transport type, except the following:

the HOLD_PRINT and HOLD_PHONE (bug 10845) are moved under HOLD-letter.
PREDUE_PHONE and OVERDUE_PHONE (bug 11867) are moved under PREDUE- and OVERDUE-letters.

Technical implementation

Database changes

- adds a new column letter.message_transport_type
- adds a new table overduerules_transport_types : association table
between overduerules and message_transport_types.
- modifies the primary key for the letter table (become module, code,
branchcode, message_transport_type)

A new updatedatabase entry changes the DB structures changes and set all
the letter.message_transport_type to 'email'. The email type is the
default type everywhere in the code.

Letter code modifications overview

Reservations (bug 10845): HOLD => C4::Reserves::_koha_notify_reserve()
Advance notices (bug 10833): PREDUE => misc/cronjobs/
Checkin/out (bug 9016): CHECKIN/CHECKOUT => C4::Circulation::SendCirculationAlert()
Item due (bug 10833): DUE => misc/cronjobs/
Item overdues (bug 10832): ODUE => misc/cronjobs/

Git patches:

Bugfixes: (in master)


Adding a letter template for a message transport type (MTT)

1. Navigate to Tools -> Notices & slips
2. Add a "New notice" or click "edit" on an existing one
2.1. You can find an empty template for each MTT, except the email which is the original letter.
2.2. Ignore the "HTML message"-checkbox unless otherwise instructed in some other instructable.
3. Fill a template as you would the letters before this feature.

Configuring overdue notifications

1. Navigate to Tools -> Overdue notice/status triggers
2. You will find the message transport types (MTT) as checkboxes.
2.1. You can select any combination of MTT letters to send when the defined delay in days has been reached. This feature sends one letter for each activated MTT. If the Patron doesn't have the contact information defined (email, smsalertnumber, ...) no letter can be sent via that MTT. If no letters can be delivered, the feature defaults to the print notification.

Message generation decision table
SMS EMAIL PRINT smsalertnumber email address
defined? generated? defined? generated? defined? generated?
ok ok
no no by default
ok ok
no no by default
ok ok
no ok
ok ok ok ok
no no ok ok
no no no no by default
ok ok ok ok
no no ok ok
no no no ok
ok ok no ok
ok ok ok ok ok ok
no no ok ok ok ok
no no no no ok ok
no no no no no ok
ok ok no no ok ok
ok ok no no no ok
no no ok ok no ok

Adding/removing message_transport_types

Currently one can only modify the available transport types for overdue rules / notice triggers.
For example:

INSERT INTO message_transport_types VALUES ('airplane');

This will add the transport type message for the tools/ and tools/

Personal tools