3 INSERT INTO config.usr_setting_type (
10 'circ.send_email_checkout_receipts',
12 oils_i18n_gettext('circ.send_email_checkout_receipts', 'Email checkout receipts by default?', 'cust', 'label'),
13 oils_i18n_gettext('circ.send_email_checkout_receipts', 'Email checkout receipts by default?', 'cust', 'description'),
17 INSERT INTO action_trigger.hook (key, core_type, description, passive)
19 'circ.checkout.batch_notify',
22 'circ.checkout.batch_notify',
23 'Notification of a group of circs',
30 INSERT INTO action_trigger.hook (key, core_type, description, passive)
32 'circ.checkout.batch_notify.session',
35 'circ.checkout.batch_notify.session',
36 'Notification of a group of circs at the end of a checkout session',
43 INSERT INTO action_trigger.event_definition (
57 'Email Checkout Receipt',
58 'circ.checkout.batch_notify.session',
62 'circ.send_email_checkout_receipts',
65 [%- user = target.0.usr -%]
66 To: [%- params.recipient_email || user.email %]
67 From: [%- helpers.get_org_setting(target.0.circ_lib.id, 'org.bounced_emails') || params.sender_email || default_sender %]
68 Subject: Checkout Receipt
69 Auto-Submitted: auto-generated
71 You checked out the following items:
73 [% FOR circ IN target %]
74 [%- copy_details = helpers.get_copy_bib_basics(circ.target_copy.id) -%]
75 Title: [% copy_details.title %]
76 Author: [% copy_details.author %]
77 Call Number: [% circ.target_copy.call_number.label %]
78 Barcode: [% circ.target_copy.barcode %]
79 Due: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]
80 Library: [% circ.circ_lib.name %]
85 INSERT INTO action_trigger.environment (
89 currval('action_trigger.event_definition_id_seq'),
90 'target_copy.call_number'
92 currval('action_trigger.event_definition_id_seq'),
93 'target_copy.location'
95 currval('action_trigger.event_definition_id_seq'),
98 currval('action_trigger.event_definition_id_seq'),