@@ -, +, @@ notices --- basket/sendbasket.pl | 135 ++++------ .../bug_3150_-_add_LIST_and_CART_notices.perl | 224 +++++++++++++++++ .../mysql/en/mandatory/sample_notices.yml | 238 ++++++++++++++++++ .../fr-CA/obligatoire/sample_notices.sql | 219 ++++++++++++++++ .../fr-FR/1-Obligatoire/sample_notices.sql | 219 ++++++++++++++++ .../data/mysql/it-IT/necessari/notices.sql | 219 ++++++++++++++++ .../nb-NO/1-Obligatorisk/sample_notices.sql | 219 ++++++++++++++++ .../mysql/pl-PL/mandatory/sample_notices.sql | 219 ++++++++++++++++ .../mysql/ru-RU/mandatory/sample_notices.sql | 219 ++++++++++++++++ .../mysql/uk-UA/mandatory/sample_notices.sql | 219 ++++++++++++++++ opac/opac-sendbasket.pl | 153 ++++------- opac/opac-sendshelf.pl | 135 ++++------ virtualshelves/sendshelf.pl | 124 ++++----- 13 files changed, 2175 insertions(+), 367 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -52,112 +52,65 @@ if ( $email_add ) { session_id => scalar $query->cookie('CGISESSID'), token => scalar $query->param('csrf_token'), }); - my $comment = $query->param('comment'); - # Since we are already logged in, no need to check credentials again - # when loading a second template. - my $template2 = C4::Templates::gettemplate( - 'basket/sendbasket.tt', 'intranet', $query, - ); + my $patron = Koha::Patrons->find( $borrowernumber ); + + my $comment = $query->param('comment'); my @bibs = split( /\//, $bib_list ); - my @results; my $iso2709; - my $marcflavour = C4::Context->preference('marcflavour'); - foreach my $biblionumber (@bibs) { - $template2->param( biblionumber => $biblionumber ); - - my $dat = GetBiblioData($biblionumber); - next unless $dat; - my $biblio = Koha::Biblios->find( $biblionumber ); - my $record = GetMarcBiblio({ - biblionumber => $biblionumber, - embed_items => 1 }); - my $marcauthorsarray = $biblio->get_authors_from_MARC; - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - - my @items = GetItemsInfo( $biblionumber ); - - my $hasauthors = 0; - if($dat->{'author'} || @$marcauthorsarray) { - $hasauthors = 1; - } - - - $dat->{MARCSUBJCTS} = $marcsubjctsarray; - $dat->{MARCAUTHORS} = $marcauthorsarray; - $dat->{HASAUTHORS} = $hasauthors; - $dat->{'biblionumber'} = $biblionumber; - $dat->{ITEM_RESULTS} = \@items; - - $iso2709 .= $record->as_usmarc(); - - push( @results, $dat ); - } - - my $resultsarray = \@results; - $template2->param( - BIBLIO_RESULTS => $resultsarray, - comment => $comment - ); - - # Getting template result - my $template_res = $template2->output(); - my $body; - - my $subject; - # Analysing information and getting mail properties - if ( $template_res =~ /(?.*)/s ) { - $subject = $+{subject}; - $subject =~ s|\n?(.*)\n?|$1|; - } - else { - $subject = "no subject"; - } - my $email_header = ""; - if ( $template_res =~ /
(.*)/s ) { - $email_header = $1; - $email_header =~ s|\n?(.*)\n?|$1|; - } - - if ( $template_res =~ /(.*)/s ) { - $body = $1; - $body =~ s|\n?(.*)\n?|$1|; - } + foreach my $bib ( @bibs ) { + my $biblio = Koha::Biblios->find($bib); + $iso2709 .= $biblio->metadata->record->as_usmarc(); + }; - my $THE_body = <param( error => 1 ); - try { + } else { + my %loops = ( + biblio => \@bibs, + ); - my $email = Koha::Email->create( - { - to => $email_add, - subject => $subject, - } + my %substitute = ( + comment => $comment, ); - $email->text_body( $THE_body ); - $email->attach( - Encode::encode( "UTF-8", $iso2709 ), - content_type => 'application/octet-stream', - name => 'basket.iso2709', - disposition => 'attachment', + my $letter = C4::Letters::GetPreparedLetter( + module => 'catalog', + letter_code => 'CART', + lang => $patron->lang, + tables => { + borrowers => $borrowernumber, + }, + message_transport_type => 'email', + loops => \%loops, + substitute => \%substitute, ); - my $library = Koha::Patrons->find( $borrowernumber )->library; - $email->send_or_die({ transport => $library->smtp_server->transport }); - $template->param( SENT => "1" ); + my $attachment = { + filename => 'basket.iso2709', + type => 'application/octet-stream', + content => Encode::encode("UTF-8", $iso2709), + }; + + my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress'); + C4::Letters::EnqueueLetter({ + letter => $letter, + message_transport_type => 'email', + borrowernumber => $patron->borrowernumber, + to_address => $email_add, + reply_address => $user_email, + attachments => [$attachment], + }); + + $template->param( SENT => 1 ); } - catch { - carp "Error sending mail: $_"; - $template->param( error => 1 ); - }; $template->param( email_add => $email_add ); + output_html_with_http_headers $query, $cookie, $template->output; } else { --- a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl +++ a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.perl @@ -0,0 +1,224 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES + ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), + ('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default') }); + + NewVersion( $DBversion, 3150, 'Add LIST and CART notices' ); +} --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ a/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1478,3 +1478,241 @@ tables: - "Barcode: [% item.barcode %]
" - "

" - "[% END %]" + + - module: catalog + code: LIST + branchcode: "" + name: "Send list" + is_html: 1 + title: "Your list: [% listname | html %]" + message_transport_type: email + lang: default + content: + - "[%- USE raw -%]" + - "

Hi,

" + - "

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

" + - "

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

" + - "
" + - "

[% comment | $raw %]

" + - "
" + - "
    " + - "[% FOREACH biblio IN biblios %]" + - "
  1. " + - "" + - "[% biblio.title | $raw %]" + - "[% IF ( biblio.subtitle ) %]" + - "[% FOREACH subtitle IN biblio.subtitle.split(' | ') %]" + - "[% subtitle | $raw %]" + - "[% END %]" + - "[% END %]" + - "[% biblio.part_number | $raw %] [% biblio.part_name | $raw %]" + - "" + - "

    " + - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]" + - "Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %]" + - "[% IF ( biblio.get_authors_from_MARC ) %]" + - "[% IF ( biblio.author ) %]; [% END %]" + - "[% FOREACH author IN biblio.get_authors_from_MARC %]" + - "[% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]" + - "[% subfield.separator | $raw %][% subfield.value | $raw %]" + - "[% END %]" + - "[% UNLESS ( loop.last ) %];[% END %]" + - "[% END %]" + - "[% END %]" + - "
    " + - "[% END %]" + - "[% SET biblioitem = biblio.biblioitem %]" + - "[% IF ( biblioitem.isbn ) %]" + - "" + - "ISBN: [% FOREACH isbn IN biblioitem.isbn %]" + - "[% isbn | $raw %]" + - "[% UNLESS ( loop.last ) %]; [% END %]" + - "[% END %]" + - "
    " + - "[% END %]" + - "[% IF ( biblioitem.publishercode ) %]" + - "" + - "Published by: [% biblioitem.publishercode | $raw %]" + - "[% IF ( biblioitem.publicationyear ) %]" + - "in [% biblioitem.publicationyear | $raw %]" + - "[% END %]" + - "[% IF ( biblioitem.pages ) %]" + - ", [% biblioitem.pages | $raw %]" + - "[% END %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.seriestitle ) %]" + - "" + - "Collection: [% biblio.seriestitle | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.copyrightdate ) %]" + - "" + - "Copyright year: [% biblio.copyrightdate | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.notes ) %]" + - "" + - "Notes: [% biblio.notes | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.unititle ) %]" + - "" + - "Unified title: [% biblio.unititle | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.serial ) %]" + - "" + - "Serial: [% biblio.serial | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblioitem.lccn ) %]" + - "" + - "LCCN: [% biblioitem.lccn | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblioitem.url ) %]" + - "" + - "URL: [% biblioitem.url | html %]" + - "" + - "[% END %]" + - "

    " + - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]" + - "[% IF ( OPACBaseURL ) %]" + - "

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    " + - "[% END %]" + - "[% IF ( biblio.items.count > 0 ) %]" + - "

    Items:" + - "

      " + - "[% FOREACH item IN biblio.items %]
    • " + - "[% item.holding_branch.branchname | $raw %]" + - "[% item.location | $raw %]" + - "[% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %]" + - "[% item.barcode | $raw %]" + - "
    • [% END %]" + - "
    " + - "

    " + - "[% END %]" + - "
    " + - "
  2. " + - "[% END %]" + - "
" + + - module: catalog + code: CART + branchcode: "" + name: "Send cart" + is_html: 1 + title: "Your cart" + message_transport_type: email + lang: default + content: + - "[%- USE raw -%]" + - "

Hi,

" + - "

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

" + - "

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

" + - "
" + - "

[% comment | $raw %]

" + - "
" + - "
    " + - "[% FOREACH biblio IN biblios %]" + - "
  1. " + - "" + - "[% biblio.title | $raw %]" + - "[% IF ( biblio.subtitle ) %]" + - "[% FOREACH subtitle IN biblio.subtitle.split(' | ') %]" + - "[% subtitle | $raw %]" + - "[% END %]" + - "[% END %]" + - "[% biblio.part_number | $raw %] [% biblio.part_name | $raw %]" + - "" + - "

    " + - "[% IF ( biblio.author || biblio.get_authors_from_MARC ) %]" + - "Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %]" + - "[% IF ( biblio.get_authors_from_MARC ) %]" + - "[% IF ( biblio.author ) %]; [% END %]" + - "[% FOREACH author IN biblio.get_authors_from_MARC %]" + - "[% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %]" + - "[% subfield.separator | $raw %][% subfield.value | $raw %]" + - "[% END %]" + - "[% UNLESS ( loop.last ) %];[% END %]" + - "[% END %]" + - "[% END %]" + - "
    " + - "[% END %]" + - "[% SET biblioitem = biblio.biblioitem %]" + - "[% IF ( biblioitem.isbn ) %]" + - "" + - "ISBN: [% FOREACH isbn IN biblioitem.isbn %]" + - "[% isbn | $raw %]" + - "[% UNLESS ( loop.last ) %]; [% END %]" + - "[% END %]" + - "
    " + - "[% END %]" + - "[% IF ( biblioitem.publishercode ) %]" + - "" + - "Published by: [% biblioitem.publishercode | $raw %]" + - "[% IF ( biblioitem.publicationyear ) %]" + - "in [% biblioitem.publicationyear | $raw %]" + - "[% END %]" + - "[% IF ( biblioitem.pages ) %]" + - ", [% biblioitem.pages | $raw %]" + - "[% END %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.seriestitle ) %]" + - "" + - "Collection: [% biblio.seriestitle | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.copyrightdate ) %]" + - "" + - "Copyright year: [% biblio.copyrightdate | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.notes ) %]" + - "" + - "Notes: [% biblio.notes | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.unititle ) %]" + - "" + - "Unified title: [% biblio.unititle | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblio.serial ) %]" + - "" + - "Serial: [% biblio.serial | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblioitem.lccn ) %]" + - "" + - "LCCN: [% biblioitem.lccn | $raw %]" + - "
    " + - "[% END %]" + - "[% IF ( biblioitem.url ) %]" + - "" + - "URL: [% biblioitem.url | html %]" + - "" + - "[% END %]" + - "

    " + - "[% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %]" + - "[% IF ( OPACBaseURL ) %]" + - "

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    " + - "[% END %]" + - "[% IF ( biblio.items.count > 0 ) %]" + - "

    Items:" + - "

      " + - "[% FOREACH item IN biblio.items %]
    • " + - "[% item.holding_branch.branchname | $raw %]" + - "[% item.location | $raw %]" + - "[% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %]" + - "[% item.barcode | $raw %]" + - "
    • [% END %]" + - "
    " + - "

    " + - "[% END %]" + - "
    " + - "
  2. " + - "[% END %]" + - "
" --- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql +++ a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql @@ -316,3 +316,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -429,3 +429,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/installer/data/mysql/it-IT/necessari/notices.sql +++ a/installer/data/mysql/it-IT/necessari/notices.sql @@ -432,3 +432,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -447,3 +447,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -426,3 +426,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -428,3 +428,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -519,3 +519,222 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); + +INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('catalog','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a list from our online catalog called: [% listname | $raw %].

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
", 'email','default' ), +('catalog','CART','','Send cart',1,'Your cart',"[%- USE raw -%] +

Hi,

+

[% borrower.firstname | $raw %] [% borrower.surname | $raw %] sent you a cart from our online catalog.

+

Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.

+
+

[% comment | $raw %]

+
+
    +[% FOREACH biblio IN biblios %] +
  1. + + [% biblio.title | $raw %] + [% IF ( biblio.subtitle ) %] + [% FOREACH subtitle IN biblio.subtitle.split(' | ') %] + [% subtitle | $raw %] + [% END %] + [% END %] + [% biblio.part_number | $raw %] [% biblio.part_name | $raw %] + +

    + [% IF ( biblio.author || biblio.get_authors_from_MARC ) %] + Author(s): [% IF ( biblio.author ) %][% biblio.author | $raw %][% END %] + [% IF ( biblio.get_authors_from_MARC ) %] + [% IF ( biblio.author ) %]; [% END %] + [% FOREACH author IN biblio.get_authors_from_MARC %] + [% FOREACH subfield IN author.MARCAUTHOR_SUBFIELDS_LOOP %] + [% subfield.separator | $raw %][% subfield.value | $raw %] + [% END %] + [% UNLESS ( loop.last ) %];[% END %] + [% END %] + [% END %] +
    + [% END %] + [% SET biblioitem = biblio.biblioitem %] + [% IF ( biblioitem.isbn ) %] + + ISBN: [% FOREACH isbn IN biblioitem.isbn %] + [% isbn | $raw %] + [% UNLESS ( loop.last ) %]; [% END %] + [% END %] +
    + [% END %] + [% IF ( biblioitem.publishercode ) %] + + Published by: [% biblioitem.publishercode | $raw %] + [% IF ( biblioitem.publicationyear ) %] + in [% biblioitem.publicationyear | $raw %] + [% END %] + [% IF ( biblioitem.pages ) %] + , [% biblioitem.pages | $raw %] + [% END %] +
    + [% END %] + [% IF ( biblio.seriestitle ) %] + + Collection: [% biblio.seriestitle | $raw %] +
    + [% END %] + [% IF ( biblio.copyrightdate ) %] + + Copyright year: [% biblio.copyrightdate | $raw %] +
    + [% END %] + [% IF ( biblio.notes ) %] + + Notes: [% biblio.notes | $raw %] +
    + [% END %] + [% IF ( biblio.unititle ) %] + + Unified title: [% biblio.unititle | $raw %] +
    + [% END %] + [% IF ( biblio.serial ) %] + + Serial: [% biblio.serial | $raw %] +
    + [% END %] + [% IF ( biblioitem.lccn ) %] + + LCCN: [% biblioitem.lccn | $raw %] +
    + [% END %] + [% IF ( biblioitem.url ) %] + + URL: [% biblioitem.url | html %] + + [% END %] +

    + [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] + [% IF ( OPACBaseURL ) %] +

    In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]

    + [% END %] + [% IF ( biblio.items.count > 0 ) %] +

    Items: +

      + [% FOREACH item IN biblio.items %]
    • + [% item.holding_branch.branchname | $raw %] + [% item.location | $raw %] + [% IF item.itemcallnumber %]([% item.itemcallnumber | $raw %])[% END %] + [% item.barcode | $raw %] +
    • [% END %] +
    +

    + [% END %] +
    +
  2. +[% END %] +
",'email','default'); --- a/opac/opac-sendbasket.pl +++ a/opac/opac-sendbasket.pl @@ -54,128 +54,65 @@ if ( $email_add ) { session_id => scalar $query->cookie('CGISESSID'), token => scalar $query->param('csrf_token'), }); - my $patron = Koha::Patrons->find( $borrowernumber ); - my $borcat = $patron ? $patron->categorycode : q{}; - my $user_email = $patron->first_valid_email_address - || C4::Context->preference('KohaAdminEmailAddress'); - my $email_replyto = $patron->firstname . " " . $patron->surname . " <$user_email>"; - my $comment = $query->param('comment'); + my $patron = Koha::Patrons->find( $borrowernumber ); - # Since we are already logged in, no need to check credentials again - # when loading a second template. - my $template2 = C4::Templates::gettemplate( - 'opac-sendbasket.tt', 'opac', $query, - ); + my $comment = $query->param('comment'); my @bibs = split( /\//, $bib_list ); - my @results; my $iso2709; - my $marcflavour = C4::Context->preference('marcflavour'); - foreach my $biblionumber (@bibs) { - $template2->param( biblionumber => $biblionumber ); - - my $dat = GetBiblioData($biblionumber); - next unless $dat; - my $biblio = Koha::Biblios->find( $biblionumber ); - my $record = GetMarcBiblio({ - biblionumber => $biblionumber, - embed_items => 1, - opac => 1, - borcat => $borcat }); - my $marcauthorsarray = $biblio->get_authors_from_MARC; - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - - my @items = GetItemsInfo( $biblionumber ); - - my $hasauthors = 0; - if($dat->{'author'} || @$marcauthorsarray) { - $hasauthors = 1; - } - - - $dat->{MARCSUBJCTS} = $marcsubjctsarray; - $dat->{MARCAUTHORS} = $marcauthorsarray; - $dat->{HASAUTHORS} = $hasauthors; - $dat->{'biblionumber'} = $biblionumber; - $dat->{ITEM_RESULTS} = \@items; - - $iso2709 .= $record->as_usmarc(); - - push( @results, $dat ); - } - - my $resultsarray = \@results; - - $template2->param( - BIBLIO_RESULTS => $resultsarray, - comment => $comment, - firstname => $patron->firstname, - surname => $patron->surname, - ); - - # Getting template result - my $template_res = $template2->output(); - my $body; - - # Analysing information and getting mail properties - my $subject; - if ( $template_res =~ /\(?.*)\/s ) { - $subject = $+{subject}; - $subject =~ s|\n?(.*)\n?|$1|; - } - else { - $subject = "no subject"; - } - - my $email_header = ""; - if ( $template_res =~ /
(.*)/s ) { - $email_header = $1; - $email_header =~ s|\n?(.*)\n?|$1|; - } - - if ( $template_res =~ /(.*)/s ) { - $body = $1; - $body =~ s|\n?(.*)\n?|$1|; - } - my $THE_body = <find($bib); + $iso2709 .= $biblio->metadata->record->as_usmarc(); + }; if ( !defined $iso2709 ) { carp "Error sending mail: empty basket"; $template->param( error => 1 ); - } - else { - try { - # if you want to use the KohaAdmin address as from, that is the default no need to set it - my $email = Koha::Email->create({ - to => $email_add, - reply_to => $email_replyto, - subject => $subject, - }); - $email->header( 'X-Abuse-Report' => C4::Context->preference('KohaAdminEmailAddress') ); - $email->text_body( $THE_body ); - $email->attach( - Encode::encode( "UTF-8", $iso2709 ), - content_type => 'application/octet-stream', - name => 'basket.iso2709', - disposition => 'attachment', - ); - my $library = $patron->library; - $email->transport( $library->smtp_server->transport ); - $email->send_or_die; - $template->param( SENT => "1" ); - } - catch { - carp "Error sending mail: $_"; - $template->param( error => 1 ); + + } else { + my %loops = ( + biblio => \@bibs, + ); + + my %substitute = ( + comment => $comment, + ); + + my $letter = C4::Letters::GetPreparedLetter( + module => 'catalog', + letter_code => 'CART', + lang => $patron->lang, + tables => { + borrowers => $borrowernumber, + }, + message_transport_type => 'email', + loops => \%loops, + substitute => \%substitute, + ); + + my $attachment = { + filename => 'basket.iso2709', + type => 'application/octet-stream', + content => Encode::encode("UTF-8", $iso2709), }; + + my $user_email = $patron->first_valid_email_address || C4::Context->preference('KohaAdminEmailAddress'); + C4::Letters::EnqueueLetter({ + letter => $letter, + message_transport_type => 'email', + borrowernumber => $patron->borrowernumber, + to_address => $email_add, + reply_address => $user_email, + attachments => [$attachment], + }); + + $template->param( SENT => 1 ); } $template->param( email_add => $email_add ); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } else { --- a/opac/opac-sendshelf.pl +++ a/opac/opac-sendshelf.pl @@ -58,7 +58,7 @@ my $shelf = Koha::Virtualshelves->find( $shelfid ); if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { if ( $email ) { - my $comment = $query->param('comment'); + my $comment = $query->param('comment'); my ( $template2, $borrowernumber, $cookie ) = get_template_and_user( { @@ -70,109 +70,66 @@ if ( $email ) { ); my $patron = Koha::Patrons->find( $borrowernumber ); - my $borcat = $patron ? $patron->categorycode : q{}; - my $shelf = Koha::Virtualshelves->find( $shelfid ); my $contents = $shelf->get_contents; - my $marcflavour = C4::Context->preference('marcflavour'); - my $iso2709; - my @results; + my @biblionumbers; + my $iso2709; while ( my $content = $contents->next ) { - my $biblionumber = $content->biblionumber; - my $record = GetMarcBiblio({ - biblionumber => $biblionumber, - embed_items => 1, - opac => 1, - borcat => $borcat }); - next unless $record; - my $biblio = Koha::Biblios->find( $biblionumber ); - my $fw = GetFrameworkCode($biblionumber); - my $dat = GetBiblioData($biblionumber); - - my $marcauthorsarray = $biblio->get_authors_from_MARC; - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - - my @items = GetItemsInfo( $biblionumber ); - - $dat->{ISBN} = GetMarcISBN($record, $marcflavour); - $dat->{MARCSUBJCTS} = $marcsubjctsarray; - $dat->{MARCAUTHORS} = $marcauthorsarray; - $dat->{'biblionumber'} = $biblionumber; - $dat->{ITEM_RESULTS} = \@items; - $dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray; - - $iso2709 .= $record->as_usmarc(); - - push( @results, $dat ); - } - - $template2->param( - BIBLIO_RESULTS => \@results, - comment => $comment, - shelfname => $shelf->shelfname, - firstname => $patron->firstname, - surname => $patron->surname, - ); - - # Getting template result - my $template_res = $template2->output(); - my $body; - - my $subject; - # Analysing information and getting mail properties - if ( $template_res =~ /(?.*)/s ) { - $subject = $+{subject}; - $subject =~ s|\n?(.*)\n?|$1|; - } - else { - $subject = "no subject"; - } + push @biblionumbers, $content->biblionumber; + my $biblio = Koha::Biblios->find($content->biblionumber); + $iso2709 .= $biblio->metadata->record->as_usmarc(); + }; - my $email_header = ""; - if ( $template_res =~ /
(.*)/s ) { - $email_header = $1; - $email_header =~ s|\n?(.*)\n?|$1|; - } + if ( !defined $iso2709 ) { + carp "Error sending mail: empty list"; + $template->param( error => 1 ); - if ( $template_res =~ /(.*)/s ) { - $body = $1; - $body =~ s|\n?(.*)\n?|$1|; - } + } else { + my %loops = ( + biblio => \@biblionumbers, + ); - my $THE_body = <create( - { - to => $email, - subject => $subject, - } + my %substitute = ( + comment => $comment, + listname => $shelf->shelfname, ); - $email->text_body( $THE_body ); - $email->attach( - Encode::encode( "UTF-8", $iso2709 ), - content_type => 'application/octet-stream', - name => 'list.iso2709', - disposition => 'attachment', + + my $letter = C4::Letters::GetPreparedLetter( + module => 'catalog', + letter_code => 'LIST', + lang => $patron->lang, + tables => { + borrowers => $borrowernumber, + }, + message_transport_type => 'email', + loops => \%loops, + substitute => \%substitute, ); - my $library = Koha::Patrons->find( $borrowernumber )->library; - $email->transport( $library->smtp_server->transport ); - $email->send_or_die; - $template->param( SENT => "1" ); + + my $attachment = { + filename => 'list.iso2709', + type => 'application/octet-stream', + content => Encode::encode("UTF-8", $iso2709), + }; + + C4::Letters::EnqueueLetter({ + letter => $letter, + message_transport_type => 'email', + borrowernumber => $patron->borrowernumber, + to_address => $email, + reply_address => $patron->first_valid_email_address, + attachments => [$attachment], + }); + + $template->param( SENT => 1 ); } - catch { - carp "Error sending mail: $_"; - $template->param( error => 1 ); - }; $template->param( shelfid => $shelfid, email => $email, ); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -59,99 +59,65 @@ if ($to_address) { } ); + my $patron = Koha::Patrons->find( $borrowernumber ); my $shelf = Koha::Virtualshelves->find( $shelfid ); my $contents = $shelf->get_contents; - my $marcflavour = C4::Context->preference('marcflavour'); - my $iso2709; - my @results; + my @biblionumbers; + my $iso2709; while ( my $content = $contents->next ) { - my $biblionumber = $content->biblionumber; - my $biblio = Koha::Biblios->find( $biblionumber ); - my $dat = GetBiblioData($biblionumber); - my $record = GetMarcBiblio({ - biblionumber => $biblionumber, - embed_items => 1 }); - my $marcauthorsarray = $biblio->get_authors_from_MARC; - my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - - my @items = GetItemsInfo($biblionumber); - - $dat->{ISBN} = GetMarcISBN($record, $marcflavour); - $dat->{MARCSUBJCTS} = $marcsubjctsarray; - $dat->{MARCAUTHORS} = $marcauthorsarray; - $dat->{'biblionumber'} = $biblionumber; - $dat->{ITEM_RESULTS} = \@items; - $dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray; - - $iso2709 .= $record->as_usmarc(); - - push( @results, $dat ); - } - - $template2->param( - BIBLIO_RESULTS => \@results, - comment => $comment, - shelfname => $shelf->shelfname, - ); - - # Getting template result - my $template_res = $template2->output(); - my $body; - - my $subject; - # Analysing information and getting mail properties - if ( $template_res =~ /(?.*)/s ) { - $subject = $+{subject}; - $subject =~ s|\n?(.*)\n?|$1|; - } - else { - $subject = "no subject"; - } + push @biblionumbers, $content->biblionumber; + my $biblio = Koha::Biblios->find($content->biblionumber); + $iso2709 .= $biblio->metadata->record->as_usmarc(); + }; - my $email_header = ""; - if ( $template_res =~ /
(.*)/s ) { - $email_header = $1; - $email_header =~ s|\n?(.*)\n?|$1|; - } + if ( !defined $iso2709 ) { + carp "Error sending mail: empty list"; + $template->param( error => 1 ); - if ( $template_res =~ /(.*)/s ) { - $body = $1; - $body =~ s|\n?(.*)\n?|$1|; - } + } else { + my %loops = ( + biblio => \@biblionumbers, + ); - my $THE_body = <create( - { - to => $to_address, - subject => $subject, - } + my %substitute = ( + comment => $comment, + listname => $shelf->shelfname, ); - $email->text_body( $THE_body ); - $email->attach( - Encode::encode("UTF-8", $iso2709), - content_type => 'application/octet-stream', - name => 'shelf.iso2709', - disposition => 'attachment', + + my $letter = C4::Letters::GetPreparedLetter( + module => 'catalog', + letter_code => 'LIST', + lang => $patron->lang, + tables => { + borrowers => $borrowernumber, + }, + message_transport_type => 'email', + loops => \%loops, + substitute => \%substitute, ); - my $library = Koha::Patrons->find( $borrowernumber )->library; - $email->send_or_die({ transport => $library->smtp_server->transport }); - $template->param( SENT => "1" ); + my $attachment = { + filename => 'shelf.iso2709', + type => 'application/octet-stream', + content => Encode::encode("UTF-8", $iso2709), + }; + + C4::Letters::EnqueueLetter({ + letter => $letter, + message_transport_type => 'email', + borrowernumber => $patron->borrowernumber, + to_address => $to_address, + reply_address => $patron->first_valid_email_address, + attachments => [$attachment], + }); + + $template->param( SENT => 1 ); } - catch { - carp "Error sending mail: $_"; - $template->param( error => 1 ); - }; $template->param( email => $to_address ); - output_html_with_http_headers $query, $cookie, $template->output; + output_html_with_http_headers $query, $cookie, $template->output; } else { $template->param( --