From: Jason Boyer Date: Mon, 20 Jun 2016 16:38:00 +0000 (-0400) Subject: LP1593834: Add Date Header to A/T Email Examples X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=780f40a960cea5867c368a106fbd326832b8c4e1;p=evergreen%2Ftadl.git LP1593834: Add Date Header to A/T Email Examples RFCs 822 and 2822 specify that a Date: header has to be sent indicating when an email was sent. Without this, clients that default to displaying the Sent Date may end up using a "NULL" date, or 1970-01-01 00:00:00 UTC, which is not ideal. This adds the header to the example A/T templates for email and SMS messages, and includes instructions on correcting existing tempalates. Signed-off-by: Jason Boyer Signed-off-by: Mike Rylander --- 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 c8960b1f22..0b5aab9dd3 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -8914,6 +8914,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Overdue Notification Auto-Submitted: auto-generated @@ -8959,6 +8960,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Overdue Items Marked Lost Auto-Submitted: auto-generated @@ -9144,6 +9146,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Hold Available Notification Auto-Submitted: auto-generated @@ -9210,6 +9213,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Hold Available Notification Auto-Submitted: auto-generated @@ -9288,6 +9292,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Long Wait Hold Notification Auto-Submitted: auto-generated @@ -9427,6 +9432,7 @@ $$ To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Acquisition Request Notification Auto-Submitted: auto-generated @@ -9462,6 +9468,7 @@ $$ To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Acquisition Request Notification Auto-Submitted: auto-generated @@ -9497,6 +9504,7 @@ $$ To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Acquisition Request Notification Auto-Submitted: auto-generated @@ -9530,6 +9538,7 @@ $$ To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Acquisition Request Notification Auto-Submitted: auto-generated @@ -9563,6 +9572,7 @@ $$ To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Acquisition Request Notification Auto-Submitted: auto-generated @@ -9608,6 +9618,7 @@ $$ [%- user = target.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || user.home_ou.email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: [% user.home_ou.name %]: library account password reset request Auto-Submitted: auto-generated @@ -10121,6 +10132,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Courtesy Notice Auto-Submitted: auto-generated @@ -10955,6 +10967,7 @@ $$ [%- SET user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Circulation History Auto-Submitted: auto-generated @@ -11022,6 +11035,7 @@ $$ [%- SET user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Hold Request History Auto-Submitted: auto-generated @@ -11132,6 +11146,7 @@ $$ [%- SET user = target.0.xact.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Payment Receipt Auto-Submitted: auto-generated @@ -11357,9 +11372,11 @@ INSERT INTO action_trigger.event_definition ( NULL, '00:00:00', $$ +[%- USE date -%] [%- SET user = target.0.owner -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Bibliographic Records Auto-Submitted: auto-generated @@ -12177,6 +12194,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Item Recall Notification Auto-Submitted: auto-generated @@ -12248,6 +12266,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Hold Request Cancelled Auto-Submitted: auto-generated @@ -12500,6 +12519,7 @@ $$ [%- SET user = target.0.queue.owner -%] To: [%- params.recipient_email || user.email || 'root@localhost' %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Bibs from Import Queue Auto-Submitted: auto-generated @@ -12643,6 +12663,7 @@ $$ [%- SET user = target.0.queue.owner -%] To: [%- params.recipient_email || user.email || 'root@localhost' %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Authorities from Import Queue Auto-Submitted: auto-generated @@ -12800,6 +12821,7 @@ $$ [%- SET user = target.0.record.queue.owner -%] To: [%- params.recipient_email || user.email || 'root@localhost' %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Import Items from Import Queue Auto-Submitted: auto-generated @@ -14421,6 +14443,7 @@ INSERT INTO action_trigger.event_definition ( '[%- USE date -%] [%- user = target.0.usr -%] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, ''%a, %d %b %Y %T -0000'', gmt => 1) %] To: [%- params.recipient_email || helpers.get_sms_gateway_email(target.0.sms_carrier,target.0.sms_notify) %] Subject: [% target.size %] hold(s) ready Auto-Submitted: auto-generated @@ -14489,6 +14512,7 @@ INSERT INTO action_trigger.event_definition ( '[%- USE date -%] From: [%- params.sender_email || default_sender %] To: [%- params.recipient_email || helpers.get_sms_gateway_email(user_data.sms_carrier,user_data.sms_notify) %] +Date: [%- date.format(date.now, ''%a, %d %b %Y %T -0000'', gmt => 1) %] Subject: Call Number Auto-Submitted: auto-generated @@ -15696,6 +15720,7 @@ $$ [%- user = target.0.usr -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Subject: Overdue Items Marked Long Overdue Auto-Submitted: auto-generated @@ -15835,6 +15860,7 @@ $$ [%- lib = target.home_ou -%] To: [%- params.recipient_email || user.email %] From: [%- helpers.get_org_setting(target.home_ou.id, 'org.bounced_emails') || lib.email || params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Reply-To: [%- helpers.get_org_setting(target.home_ou.id, 'org.bounced_emails') || lib.email || params.sender_email || default_sender %] Subject: Courtesy Notice - Library Account Expiration in 30 days Auto-Submitted: auto-generated @@ -15884,6 +15910,7 @@ $$ [%- lib = target.home_ou -%] To: [%- params.recipient_email || user.email %] From: [%- helpers.get_org_setting(target.home_ou.id, 'org.bounced_emails') || lib.email || params.sender_email || default_sender %] +Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %] Reply-To: [%- helpers.get_org_setting(target.home_ou.id, 'org.bounced_emails') || lib.email || params.sender_email || default_sender %] Subject: New Library Account Sign-up - Welcome! Auto-Submitted: auto-generated diff --git a/docs/RELEASE_NOTES_NEXT/Administration/Action_Trigger_Email_Headers.adoc b/docs/RELEASE_NOTES_NEXT/Administration/Action_Trigger_Email_Headers.adoc new file mode 100644 index 0000000000..a38fdc43eb --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Administration/Action_Trigger_Email_Headers.adoc @@ -0,0 +1,16 @@ +Add Date Header to Action Trigger Email/SMS Templates +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The Date: header specified in RFC 2822 has been added to the seed data +for the example Action Trigger email and SMS templates, but no attempt +has been made to automatically modify existing templates. To add this +header (and end any "Why are my library emails from 1969/70?" questions +you may have heard) make sure the following lines are in all templates +that use the SendEmail or SendSMS reactors: + +The first is already in most sample templates, but you may need to add +it to the top of any custom templates: +`[%- USE date -%]` + +And this line should be inserted into the header block of each template: +`Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %]` +