X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FMessage.pm;h=30b71c827c206a1a58bb609da27d528cfc58849a;hb=f839955db707415368d23ae81bdb14505dd058ee;hp=a63b3caa9656a21e950fafddeda7e0d227521cf7;hpb=ee3eee451d2c36ff58f9443c86a8522ef905eca1;p=koha.git diff --git a/C4/Message.pm b/C4/Message.pm index a63b3caa96..30b71c827c 100644 --- a/C4/Message.pm +++ b/C4/Message.pm @@ -5,18 +5,18 @@ package C4::Message; # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . use strict; @@ -159,8 +159,13 @@ sub enqueue { my ($class, $letter, $borrower, $transport) = @_; my $metadata = _metadata($letter); my $to_address = _to_address($borrower, $transport); + + # Same as render_metadata + my $format ||= sub { $_[0] || "" }; + my $body = join('', map { $format->($_) } @{$metadata->{body}}); + $letter->{content} = $metadata->{header} . $body . $metadata->{footer}; + $letter->{metadata} = Dump($metadata); - #carp "enqueuing... to $to_address"; C4::Letters::EnqueueLetter({ letter => $letter, borrowernumber => $borrower->{borrowernumber},