Evergreen should allow for HTML formatted action trigger emails

Bug #1532236 reported by Blake GH on 2016-01-08
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Evergreen
Wishlist
Unassigned

Bug Description

It would be great if you could formulate your own email headers for action triggers in the action trigger template. If you so desired. If you do not include the Content-Type in the email header, then Evergreen can go ahead and make one.

Blake GH (bmagic) wrote :

Here is an example of an email we would like to have sent in HTML if the mail client supports it. If not, it should show the plain text version.

[%- USE date -%]
[%- user = target.0.usr -%]
To: [%- params.recipient_email || user.email %]
From: [%- target.0.circ_lib.name %] <[% helpers.get_org_setting(target.0.circ_lib.id, 'org.bounced_emails') || lib.email || params.sender_email || default_sender %]>
MIME-Version: 1.0
Content-Type: multipart/alternative;boundary=separatehere
Subject: Overdue Notification

Dear [% user.first_given_name %] [% user.family_name %],

Did you forget? Currently the following items are overdue. Checked out items may be renewed one time if no other patron is requesting the item. Renew by phone at {removed} or online from the library's website: {removed}.

[% FOR circ IN target %]
    Title: [% circ.target_copy.call_number.record.simple_record.title %]
    Barcode: [% circ.target_copy.barcode %]
    Due: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]
    Item Cost: [% helpers.get_copy_price(circ.target_copy) %]
[% END %]

{removed}
p: {removed}
e: {removed}
Library Hours: Monday - Thursday: 9 a.m. - 7 p.m. | Friday - Saturday: 10 a.m. - 5 p.m. | Sunday 1 p.m. - 5 p.m. (Sept. - May)

Login in to http://{removed}/eg/opac/myopac/main?locg=2 to renew your items or place items on hold.

Please note: {removed} operates on the principle that our patrons can be trusted to return materials in a timely manner. Currently, fines are not charged for overdue materials. However, items are considered lost after 45 days overdue. Lost items are billed at the item's original cost plus a $10 non-refundable processing fee.
--separatehere
Content-Type: text/html;charset=utf-8

<p>Dear [% user.first_given_name %] [% user.family_name %],</p>
<p>
Did you forget? Currently the following items are overdue. Checked out items may be renewed one time if no other patron is requesting the item. Renew by phone at {removed} or online from the library's website: {removed}.
</p>
<pre>
[% FOR circ IN target %]
    Title: [% circ.target_copy.call_number.record.simple_record.title %]
    Barcode: [% circ.target_copy.barcode %]
    Due: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]
    Item Cost: [% helpers.get_copy_price(circ.target_copy) %]
[% END %]
</pre>

{removed}<br>
p: {removed}<br>
e: {removed}<br>
Library Hours: Monday - Thursday: 9 a.m. - 7 p.m. | Friday - Saturday: 10 a.m. - 5 p.m. | Sunday 1 p.m. - 5 p.m. (Sept. - May)<br>

<p>
Login in to <a href="http://{removed}/eg/opac/myopac/main?locg=2">My Account</a> to renew your items or place items on hold.
</p>
<p>
Please note: {removed} operates on the principle that our patrons can be trusted to return materials in a timely manner. <i>Currently, fines are not charged for overdue materials.</i> However, items are considered lost after 45 days overdue. Lost items are billed at the item's original cost plus a $10 non-refundable processing fee.</p>
--separatehere--

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Wishlist
Blake GH (bmagic) wrote :

Warning: If you have templates that specify a Content-Type and you have been confused why it wasn't working. And forgot about it, your emails will start sending with that Content-Type - which might result in ill formatted messages depending on the state of the body of the message.

Kathy Lussier (klussier) on 2016-09-02
Changed in evergreen:
milestone: none → 2.next
tags: added: actiontrigger
Jason Stephenson (jstephenson) wrote :

Note that the proposed fix for bug 1801163 may very well break this branch. I have not tested the two together.

There is also the possibility that the resolution to bug 1466502 will also break this. I'm pretty sure that if Email::Stuffer is used, this branch will no longer work, and may not even be possible without drastic changes to the A/T templating system.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers