X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-sendbasket.pl;h=ca3a9736381b1320592a83e801c81a1a9fa7cddd;hb=d90b4b6a08aa946fd40d1c1a45d1cc4ad64c30e5;hp=da74745f2e17dbf65370a33660c811b1e57b2fe4;hpb=b1e2fa8fcaad4d8649e185fbcce2c7210bd8d40a;p=koha_fer diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index da74745f2e..ca3a973638 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -127,25 +127,33 @@ if ( $email_add ) { my $body; # Analysing information and getting mail properties - if ( $template_res =~ /\n(.*)\n?/s ) { - $mail{'subject'} = $1; + + if ( $template_res =~ /(.*)/s ) { + $mail{subject} = $1; + $mail{subject} =~ s|\n?(.*)\n?|$1|; } else { $mail{'subject'} = "no subject"; } my $email_header = ""; - if ( $template_res =~ /
\n(.*)\n?/s ) { - $email_header = encode_qp($1); + if ( $template_res =~ /
(.*)/s ) { + $email_header = $1; + $email_header =~ s|\n?(.*)\n?|$1|; } my $email_file = "basket.txt"; - if ( $template_res =~ /\n(.*)\n?/s ) { + if ( $template_res =~ /(.*)/s ) { $email_file = $1; + $email_file =~ s|\n?(.*)\n?|$1|; } - if ( $template_res =~ /\n(.*)\n?/s ) { - $body = encode_qp($1); + if ( $template_res =~ /(.*)/s ) { + $body = $1; + $body =~ s|\n?(.*)\n?|$1|; + $body = encode("UTF-8", encode_qp($body)); } + $mail{body} = $body; + my $boundary = "====" . time() . "===="; $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";