<<

NAME

borrowers-force-messaging-defaults.pl

SYNOPSIS

  borrowers-force-messaging-defaults.pl
  borrowers-force-messaging-defaults.pl --help
  borrowers-force-messaging-defaults.pl --doit
  borrowers-force-messaging-defaults.pl --doit --not-expired
  borrowers-force-messaging-defaults.pl --doit --category PT
  borrowers-force-messaging-defaults.pl --doit --library CPL
  borrowers-force-messaging-defaults.pl --doit --message-name 'Item_Due'

DESCRIPTION

If the EnhancedMessagingPreferences syspref is enabled after borrowers have been created in the DB, those borrowers won't have messaging transport preferences default values as defined for their borrower category. So you would have to modify each borrower one by one if you would like to send them 'Hold Filled' notice for example.

This script creates/overwrites messaging preferences for all borrowers and sets them to default values defined for the category they belong to (unless you use the options -not-expired or -no-overwrite to update a subset).

--help

Prints this help

--doit

Actually update the borrowers.

--not-expired

Will only update active borrowers (borrowers who didn't pass their expiration date).

--no-overwrite

Will only update patrons without messaging preferences and skip patrons that already set their preferences.

--category

Will only update patrons in the category specified.

--library

Will only update patrons whose home library matches the given library id.

--message-name

Will only update the specified message name. List of values can be found in installer/data/mysql/mandatory/sample_notices_message_attributes.sql or in message_attributes.message_name in the database.

--since

Will only update borrowers enrolled since the specified date.

Examples:

--since "2022-07-13"

--since `date -d "1 day ago" '+%Y-%m-%d'

<<