]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0084.data.hold_request.long_wait.sql
LP#1206936 - Fix wrong billing info in money.transaction_billing_summary
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0084.data.hold_request.long_wait.sql
1 BEGIN;
2
3 INSERT INTO config.upgrade_log (version) VALUES ('0084'); -- senator
4
5 INSERT INTO action_trigger.hook (
6         key,
7         core_type,
8         description,
9         passive
10     ) VALUES (
11         'hold_request.long_wait',
12         'ahr',
13         'A patron has been waiting on a hold to be fulfilled for a long time.',
14         TRUE
15     );
16
17 INSERT INTO action_trigger.event_definition (
18         id,
19         active,
20         owner,
21         name,
22         hook,
23         validator,
24         reactor,
25         delay,
26         delay_field,
27         group_field,
28         template
29     ) VALUES (
30         9,
31         FALSE,
32         1,
33         'Hold waiting for pickup for long time',
34         'hold_request.long_wait',
35         'NOOP_True',
36         'SendEmail',
37         '6 MONTHS',
38         'request_time',
39         'usr',
40 $$
41 [%- USE date -%]
42 [%- user = target.0.usr -%]
43 To: [%- params.recipient_email || user.email %]
44 From: [%- params.sender_email || default_sender %]
45 Subject: Long Wait Hold Notification
46
47 Dear [% user.family_name %], [% user.first_given_name %]
48
49 You requested hold(s) on the following item(s), but unfortunately
50 we have not been able to fulfill your request after a considerable
51 length of time.  If you would still like to recieve these items,
52 no action is required.
53
54 [% FOR hold IN target %]
55     Title: [% hold.bib_rec.bib_record.simple_record.title %]
56     Author: [% hold.bib_rec.bib_record.simple_record.author %]
57 [% END %]
58 $$
59 );
60
61 INSERT INTO action_trigger.environment (
62         event_def,
63         path
64     ) VALUES
65     (9, 'pickup_lib'),
66     (9, 'usr'),
67     (9, 'bib_rec.bib_record.simple_record');
68
69
70 COMMIT;