|
Lines 342-348
sub SendAlerts {
Link Here
|
| 342 |
); |
342 |
); |
| 343 |
|
343 |
|
| 344 |
if ( $letter->{is_html} ) { |
344 |
if ( $letter->{is_html} ) { |
| 345 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) ); |
345 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title}, 'email' ) ); |
| 346 |
} else { |
346 |
} else { |
| 347 |
$mail->text_body( $letter->{content} ); |
347 |
$mail->text_body( $letter->{content} ); |
| 348 |
} |
348 |
} |
|
Lines 514-520
sub SendAlerts {
Link Here
|
| 514 |
); |
514 |
); |
| 515 |
|
515 |
|
| 516 |
if ( $letter->{is_html} ) { |
516 |
if ( $letter->{is_html} ) { |
| 517 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) ); |
517 |
$mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title}, 'email' ) ); |
| 518 |
} else { |
518 |
} else { |
| 519 |
$mail->text_body( "" . $letter->{content} ); |
519 |
$mail->text_body( "" . $letter->{content} ); |
| 520 |
} |
520 |
} |
|
Lines 1324-1330
sub _add_attachments {
Link Here
|
| 1324 |
my $message = Koha::Email->new; |
1324 |
my $message = Koha::Email->new; |
| 1325 |
|
1325 |
|
| 1326 |
if ( $letter->{is_html} ) { |
1326 |
if ( $letter->{is_html} ) { |
| 1327 |
$message->html_body( _wrap_html( $letter->{content}, $letter->{title} ) ); |
1327 |
$message->html_body( _wrap_html( $letter->{content}, $letter->{title}, 'email' ) ); |
| 1328 |
} else { |
1328 |
} else { |
| 1329 |
$message->text_body( $letter->{content} ); |
1329 |
$message->text_body( $letter->{content} ); |
| 1330 |
} |
1330 |
} |
|
Lines 1553-1559
sub _send_message_by_email {
Link Here
|
| 1553 |
} else { |
1553 |
} else { |
| 1554 |
$email = Koha::Email->create($params); |
1554 |
$email = Koha::Email->create($params); |
| 1555 |
if ($is_html) { |
1555 |
if ($is_html) { |
| 1556 |
$email->html_body( _wrap_html( $content, $subject ) ); |
1556 |
$email->html_body( _wrap_html( $content, $subject, 'email' ) ); |
| 1557 |
} else { |
1557 |
} else { |
| 1558 |
$email->text_body($content); |
1558 |
$email->text_body($content); |
| 1559 |
} |
1559 |
} |
|
Lines 1635-1644
sub _send_message_by_email {
Link Here
|
| 1635 |
} |
1635 |
} |
| 1636 |
|
1636 |
|
| 1637 |
sub _wrap_html { |
1637 |
sub _wrap_html { |
| 1638 |
my ( $content, $title ) = @_; |
1638 |
my ( $content, $title, $type ) = @_; |
| 1639 |
|
1639 |
my $stylesheets = ''; |
| 1640 |
my $css = C4::Context->preference("NoticeCSS") || ''; |
1640 |
|
| 1641 |
$css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css; |
1641 |
my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || ''; |
|
|
1642 |
$stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">} if $all_stylesheets; |
| 1643 |
my $all_style_pref = C4::Context->preference("AllNoticeCSS"); |
| 1644 |
$stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref; |
| 1645 |
if ( $type eq 'email' ) { |
| 1646 |
my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || ''; |
| 1647 |
$stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">} if $email_stylesheet; |
| 1648 |
my $email_style_pref = C4::Context->preference("EmailNoticeCSS"); |
| 1649 |
$stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref; |
| 1650 |
} |
| 1651 |
if ( $type eq 'print' ) { |
| 1652 |
my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || ''; |
| 1653 |
$stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">} if $print_stylesheet; |
| 1654 |
my $print_style_pref = C4::Context->preference("PrintNoticeCSS"); |
| 1655 |
$stylesheets .= qq{<style type="text/css">$print_style_pref</style>} if $print_style_pref; |
| 1656 |
} |
| 1657 |
$stylesheets =~ s/\n+\z//; |
| 1642 |
return <<EOS; |
1658 |
return <<EOS; |
| 1643 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1659 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 1644 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1660 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
Lines 1646-1652
sub _wrap_html {
Link Here
|
| 1646 |
<head> |
1662 |
<head> |
| 1647 |
<title>$title</title> |
1663 |
<title>$title</title> |
| 1648 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
1664 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 1649 |
$css |
1665 |
$stylesheets |
| 1650 |
</head> |
1666 |
</head> |
| 1651 |
<body> |
1667 |
<body> |
| 1652 |
$content |
1668 |
$content |