Lines 340-346
sub SendAlerts {
Link Here
|
340 |
); |
340 |
); |
341 |
|
341 |
|
342 |
if ( $letter->{is_html} ) { |
342 |
if ( $letter->{is_html} ) { |
343 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) ); |
343 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title}, 'email' ) ); |
344 |
} |
344 |
} |
345 |
else { |
345 |
else { |
346 |
$mail->text_body( $letter->{content} ); |
346 |
$mail->text_body( $letter->{content} ); |
Lines 516-522
sub SendAlerts {
Link Here
|
516 |
); |
516 |
); |
517 |
|
517 |
|
518 |
if ( $letter->{is_html} ) { |
518 |
if ( $letter->{is_html} ) { |
519 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) ); |
519 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title}, 'email' ) ); |
520 |
} |
520 |
} |
521 |
else { |
521 |
else { |
522 |
$mail->text_body( "" . $letter->{content} ); |
522 |
$mail->text_body( "" . $letter->{content} ); |
Lines 1266-1272
sub _add_attachments {
Link Here
|
1266 |
my $message = Koha::Email->new; |
1266 |
my $message = Koha::Email->new; |
1267 |
|
1267 |
|
1268 |
if ( $letter->{is_html} ) { |
1268 |
if ( $letter->{is_html} ) { |
1269 |
$message->html_body( _wrap_html( $letter->{content}, $letter->{title} ) ); |
1269 |
$message->html_body( _wrap_html( $letter->{content}, $letter->{title}, 'email' ) ); |
1270 |
} |
1270 |
} |
1271 |
else { |
1271 |
else { |
1272 |
$message->text_body( $letter->{content} ); |
1272 |
$message->text_body( $letter->{content} ); |
Lines 1488-1494
sub _send_message_by_email {
Link Here
|
1488 |
} else { |
1488 |
} else { |
1489 |
$email = Koha::Email->create($params); |
1489 |
$email = Koha::Email->create($params); |
1490 |
if ($is_html) { |
1490 |
if ($is_html) { |
1491 |
$email->html_body( _wrap_html( $content, $subject ) ); |
1491 |
$email->html_body( _wrap_html( $content, $subject, 'email' ) ); |
1492 |
} else { |
1492 |
} else { |
1493 |
$email->text_body($content); |
1493 |
$email->text_body($content); |
1494 |
} |
1494 |
} |
Lines 1573-1582
sub _send_message_by_email {
Link Here
|
1573 |
} |
1573 |
} |
1574 |
|
1574 |
|
1575 |
sub _wrap_html { |
1575 |
sub _wrap_html { |
1576 |
my ($content, $title) = @_; |
1576 |
my ( $content, $title, $type ) = @_; |
1577 |
|
1577 |
|
1578 |
my $css = C4::Context->preference("NoticeCSS") || ''; |
1578 |
my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || ''; |
1579 |
$css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css; |
1579 |
$all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">} if $all_stylesheets; |
|
|
1580 |
my $all_style_pref = C4::Context->preference("EmailNoticeCSS"); |
1581 |
$all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref; |
1582 |
if ( $type eq 'email' ) { |
1583 |
my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || ''; |
1584 |
$all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">} if $email_stylesheet; |
1585 |
my $email_style_pref = C4::Context->preference("EmailNoticeCSS"); |
1586 |
$all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref; |
1587 |
} |
1588 |
if ( $type eq 'print' ) { |
1589 |
my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || ''; |
1590 |
$all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">} if $print_stylesheet; |
1591 |
my $print_style_pref = C4::Context->preference("PrintNoticeCSS"); |
1592 |
$all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>} if $print_style_pref; |
1593 |
} |
1580 |
return <<EOS; |
1594 |
return <<EOS; |
1581 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1595 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1582 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1596 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
Lines 1584-1590
sub _wrap_html {
Link Here
|
1584 |
<head> |
1598 |
<head> |
1585 |
<title>$title</title> |
1599 |
<title>$title</title> |
1586 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
1600 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
1587 |
$css |
1601 |
$all_stylesheets |
1588 |
</head> |
1602 |
</head> |
1589 |
<body> |
1603 |
<body> |
1590 |
$content |
1604 |
$content |