From: Bill Erickson Date: Mon, 6 Jun 2011 21:07:27 +0000 (-0400) Subject: Sample hold cancelled with no target notice X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aa861552a03d3b896e21723071549478454eb0ff;p=evergreen%2Ftadl.git Sample hold cancelled with no target notice Signed-off-by: Bill Erickson Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 191da0fad5..dc036a91d4 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -8756,3 +8756,35 @@ INSERT INTO config.org_unit_setting_type 'bool' ); +-- Event def for email notice for hold cancelled due to lack of target ----- + +INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, delay, delay_field, group_field, template) + VALUES (38, FALSE, 1, + 'Hold Cancelled (No Target) Email Notification', + 'hold_request.cancel.expire_no_target', + 'HoldIsCancelled', 'SendEmail', '30 minutes', 'cancel_time', 'usr', +$$ +[%- USE date -%] +[%- user = target.0.usr -%] +To: [%- params.recipient_email || user.email %] +From: [%- params.sender_email || default_sender %] +Subject: Hold Request Cancelled + +Dear [% user.family_name %], [% user.first_given_name %] +The following holds were cancelled because no items were found to fullfil the hold. + +[% FOR hold IN target %] + Title: [% hold.bib_rec.bib_record.simple_record.title %] + Author: [% hold.bib_rec.bib_record.simple_record.author %] + Library: [% hold.pickup_lib.name %] + Request Date: [% date.format(helpers.format_date(hold.rrequest_time), '%Y-%m-%d') %] +[% END %] + +$$); + +INSERT INTO action_trigger.environment (event_def, path) VALUES + (38, 'usr'), + (38, 'pickup_lib'), + (38, 'bib_rec.bib_record.simple_record'); + + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.delete_empty_volume.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.delete_empty_volume.sql index d4a529fd00..6c0b6f8df4 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.delete_empty_volume.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.delete_empty_volume.sql @@ -15,4 +15,34 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) 'bool' ); +INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, delay, delay_field, group_field, template) + VALUES (38, FALSE, 1, + 'Hold Cancelled (No Target) Email Notification', + 'hold_request.cancel.expire_no_target', + 'HoldIsCancelled', 'SendEmail', '30 minutes', 'cancel_time', 'usr', +$$ +[%- USE date -%] +[%- user = target.0.usr -%] +To: [%- params.recipient_email || user.email %] +From: [%- params.sender_email || default_sender %] +Subject: Hold Request Cancelled + +Dear [% user.family_name %], [% user.first_given_name %] +The following holds were cancelled because no items were found to fullfil the hold. + +[% FOR hold IN target %] + Title: [% hold.bib_rec.bib_record.simple_record.title %] + Author: [% hold.bib_rec.bib_record.simple_record.author %] + Library: [% hold.pickup_lib.name %] + Request Date: [% date.format(helpers.format_date(hold.rrequest_time), '%Y-%m-%d') %] +[% END %] + +$$); + +INSERT INTO action_trigger.environment (event_def, path) VALUES + (38, 'usr'), + (38, 'pickup_lib'), + (38, 'bib_rec.bib_record.simple_record'); + + COMMIT;