BEGIN; INSERT INTO config.upgrade_log (version) VALUES ('0079'); -- senator INSERT INTO action_trigger.hook ( key, core_type, description, passive ) VALUES ( 'hold_request.shelf_expires_soon', 'ahr', 'A hold on the shelf will expire there soon.', TRUE ); INSERT INTO action_trigger.event_definition ( id, active, owner, name, hook, validator, reactor, delay, delay_field, group_field, template ) VALUES ( 7, FALSE, 1, 'Hold Expires from Shelf Soon', 'hold_request.shelf_expires_soon', 'HoldIsAvailable', 'SendEmail', '- 1 DAY', 'shelf_expire_time', 'usr', $$ [%- USE date -%] [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] Subject: Hold Available Notification Dear [% user.family_name %], [% user.first_given_name %] You requested holds on the following item(s), which are available for pickup, but these holds will soon expire. [% FOR hold IN target %] [%- data = helpers.get_copy_bib_basics(hold.current_copy.id) -%] Title: [% data.title %] Author: [% data.author %] Library: [% hold.pickup_lib.name %] [% END %] $$ ); INSERT INTO action_trigger.environment ( event_def, path ) VALUES ( 7, 'current_copy'), ( 7, 'pickup_lib.billing_address'), ( 7, 'usr'); COMMIT;