{
-
"checkout.due" :
{ "context_org" : "circ_lib",
"filter" :
{ "stop_fines" : null }
]
}
+ },
+ "hold_request.shelf_expires_soon" : {
+ "context_org": "pickup_lib",
+ "filter": {
+ "shelf_expire_time": {"!=": null},
+ "capture_time": {"!=": null},
+ "current_copy": {"!=": null},
+ "shelf_time": {"!=": null},
+ "cancel_time": null
+ }
}
-
}
-
$$);
+
+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.environment (event_def, path) VALUES
(5, 'current_copy.call_number.record.simple_record'),
(5, 'usr'),
(5, 'pickup_lib.billing_address');
+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');
+
SELECT SETVAL('action_trigger.event_definition_id_seq'::TEXT, 100);
-- Org Unit Settings for configuring org unit weights and org unit max-loops for hold targeting
'A hold is cancelled by the patron'
);
+
+
-- hold targeter skip me
INSERT INTO config.org_unit_setting_type (name, label, description, datatype) VALUES (
'circ.holds.target_skip_me',
--- /dev/null
+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;