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 1283-1289
sub _add_attachments {
Link Here
|
1283 |
my $message = Koha::Email->new; |
1283 |
my $message = Koha::Email->new; |
1284 |
|
1284 |
|
1285 |
if ( $letter->{is_html} ) { |
1285 |
if ( $letter->{is_html} ) { |
1286 |
$message->html_body( _wrap_html( $letter->{content}, $letter->{title} ) ); |
1286 |
$message->html_body( _wrap_html( $letter->{content}, $letter->{title}, 'email' ) ); |
1287 |
} |
1287 |
} |
1288 |
else { |
1288 |
else { |
1289 |
$message->text_body( $letter->{content} ); |
1289 |
$message->text_body( $letter->{content} ); |
Lines 1505-1511
sub _send_message_by_email {
Link Here
|
1505 |
} else { |
1505 |
} else { |
1506 |
$email = Koha::Email->create($params); |
1506 |
$email = Koha::Email->create($params); |
1507 |
if ($is_html) { |
1507 |
if ($is_html) { |
1508 |
$email->html_body( _wrap_html( $content, $subject ) ); |
1508 |
$email->html_body( _wrap_html( $content, $subject, 'email' ) ); |
1509 |
} else { |
1509 |
} else { |
1510 |
$email->text_body($content); |
1510 |
$email->text_body($content); |
1511 |
} |
1511 |
} |
Lines 1590-1599
sub _send_message_by_email {
Link Here
|
1590 |
} |
1590 |
} |
1591 |
|
1591 |
|
1592 |
sub _wrap_html { |
1592 |
sub _wrap_html { |
1593 |
my ($content, $title) = @_; |
1593 |
my ( $content, $title, $type ) = @_; |
1594 |
|
1594 |
|
1595 |
my $css = C4::Context->preference("NoticeCSS") || ''; |
1595 |
my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || ''; |
1596 |
$css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css; |
1596 |
$all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">} if $all_stylesheets; |
|
|
1597 |
my $all_style_pref = C4::Context->preference("AllNoticeCSS"); |
1598 |
$all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref; |
1599 |
if ( $type eq 'email' ) { |
1600 |
my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || ''; |
1601 |
$all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">} if $email_stylesheet; |
1602 |
my $email_style_pref = C4::Context->preference("EmailNoticeCSS"); |
1603 |
$all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref; |
1604 |
} |
1605 |
if ( $type eq 'print' ) { |
1606 |
my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || ''; |
1607 |
$all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">} if $print_stylesheet; |
1608 |
my $print_style_pref = C4::Context->preference("PrintNoticeCSS"); |
1609 |
$all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>} if $print_style_pref; |
1610 |
} |
1597 |
return <<EOS; |
1611 |
return <<EOS; |
1598 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1612 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1599 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1613 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
Lines 1601-1607
sub _wrap_html {
Link Here
|
1601 |
<head> |
1615 |
<head> |
1602 |
<title>$title</title> |
1616 |
<title>$title</title> |
1603 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
1617 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
1604 |
$css |
1618 |
$all_stylesheets |
1605 |
</head> |
1619 |
</head> |
1606 |
<body> |
1620 |
<body> |
1607 |
$content |
1621 |
$content |