From: Dan Scott Date: Tue, 9 Oct 2012 16:21:10 +0000 (-0400) Subject: Remove extraneous spaces from bib email template X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Ffeature%2Fcallno_tpac_template_2_4;p=contrib%2FConifer.git Remove extraneous spaces from bib email template Various email servers refuse to send email that begins with blank lines, so use TT's [%- and -%] to eat up whitespace. Also, remove the extra linefeeds (_ "\n") as the linefeed is already generated by virtue of being on its own line. Signed-off-by: Dan Scott --- 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 6e482adff9..05d5aae6bf 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -8791,15 +8791,15 @@ INSERT INTO action_trigger.event_definition ( NULL, '00:00:00', $$ -[% SET user = target.0.owner; +[%- SET user = target.0.owner; SET print_limit = 500; #this is to limit the no. of copies, set to 0 for unlimited - SET tpac_host = ''; # tpac_host can be specfied directly %] + SET tpac_host = 'http://www.concat.ca'; # tpac_host can be specfied directly -%] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] Subject: Bibliographic Records [% FOR cbreb IN target %] -[% FOR item IN cbreb.items; +[%- FOR item IN cbreb.items; bre_id = item.target_biblio_record_entry; bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'}); @@ -8871,42 +8871,41 @@ Subject: Bibliographic Records END; END; -%] +-%] [% loop.count %]/[% loop.size %]. Bib ID# [% bre_id %] -[% IF tpac_host.length != 0 %]URL: [% tpac_host %]/eg/opac/record/[% bre_id _ "\n" %][% END %] -[% IF isbn %]ISBN: [% isbn _ "\n" %][% END %] -[% IF issn %]ISSN: [% issn _ "\n" %][% END %] -[% IF upc %]UPC: [% upc _ "\n" %] [% END %] +[%- IF tpac_host.length != 0 %]URL: [% tpac_host %]/eg/opac/record/[% bre_id _ "\n" %][% END %] +[%- IF isbn %]ISBN: [% isbn %][% END %] +[%- IF issn %]ISSN: [% issn %][% END %] +[%- IF upc %]UPC: [% upc %] [% END %] Title: [% title %] Author: [% author %] Publication Info: [% publisher %] [% pubdate %] Item Type: [% item_type %] -[% IF holdings.size > 0 %] - [% IF holdings.size > print_limit AND print_limit > 0 %] +[%- IF holdings.size > 0 %] + [%- IF holdings.size > print_limit AND print_limit > 0 %] Showing [% print_limit %] of [% holdings.size %], use URL for full list of copies... - [% END %] - [% FOR holding IN holdings %] - Location: [% holding.library %] - [% holding.location _ "\n" %] - Call Number: [% holding.label _ "\n" %][% IF holding.part_label %][% holding.part_label _ "\n" %][% END %] - Status: [% holding.status _ "\n" %] - [% END %] -[% END %] -[% IF uris.size > 0 %] - [% FOR uri IN uris %] - URL: [% uri.href _ "\n" %] - [% END %] - [% IF uri.link.length > 0 %] - Label: [% uri.link _ "\n" %] - [% END %] - [% IF uri.note.length > 0 %] - Note: [% uri.note _ "\n" %] + [%- END %] + [%- FOR holding IN holdings %] + Location: [% holding.library %] - [% holding.location %] + Call Number: [% holding.label %][% IF holding.part_label %][% holding.part_label %][% END %] + Status: [% holding.status %] [% END %] [% END %] - -[% END %] -[% END %] +[%- IF uris.size > 0 %] + [%- FOR uri IN uris %] + URL: [% uri.href %] + [%- END %] + [%- IF uri.link.length > 0 %] + Label: [% uri.link %] + [%- END %] + [%- IF uri.note.length > 0 %] + Note: [% uri.note %] + [%- END %] +[%- END %] +[%- END %] +[%- END %] $$ ) ,(