C4::Members::Messaging - manage patron messaging preferences
use C4::Members::Messaging
This module lets you modify a patron's messaging preferences.
my $preferences = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrower->{'borrowernumber'}, message_name => 'Item_Due ' } ); my $preferences = C4::Members::Messaging::GetMessagingPreferences( { categorycode => 'LIBRARY', message_name => 'Item_Due ' } );
returns: a hashref of messaging preferences for a borrower or patron category for a particlar message_name
Requires either a borrowernumber or a categorycode key, but not both.
message_name argument is a message attribute name.
This method defines how a user (or a default for a patron category) wants to get a certain message delivered. The list of valid message types can be delivered can be found in the message_attributes
table, and the list of valid message transports can be found in the message_transport_types
table.
C4::Members::Messaging::SetMessagingPreference( { borrowernumber => $borrower->{'borrowernumber'} message_attribute_id => $message_attribute_id, message_transport_types => [ qw( email sms ) ], days_in_advance => 5 wants_digest => 1 } )
returns nothing useful.
my $messaging_options = C4::Members::Messaging::GetMessagingOptions()
returns a hashref of messaging options available.
C4::Members::Messaging::SetMessagingPreferencesFromDefaults( { borrowernumber => $borrower->{'borrowernumber'} categorycode => 'CPL' } );
Given a borrowernumber and a patron category code (from the borrowernumber
and categorycode
keys in the parameter hashref), replace all of the patron's current messaging preferences with whatever defaults are defined for the patron category.
The actual messages which will be sent via a cron job running misc/cronjobs/process_message_queue.pl.
What kinds of messages can be sent?
What transports can messages be sent vith? (email, sms, etc.)
How are message_attributes and message_transport_types correlated?
What messages do the borrowers want to receive?
What transport should a message be sent with?
Koha Development Team <http://koha-community.org/>
Andrew Moore <andrew.moore@liblime.com>