@@ -, +, @@
wrapping
---
Koha/Notice/Message.pm | 31 +++++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
--- a/Koha/Notice/Message.pm
+++ a/Koha/Notice/Message.pm
@@ -31,6 +31,20 @@ Koha::Notice::Message - Koha notice message Object class, related to the message
=cut
+=head3 is_html
+
+ my $bool = $message->is_html;
+
+Returns a boolean denoting whether the message was generated using a preformatted html template.
+
+=cut
+
+sub is_html {
+ my ($self) = @_;
+ my $content_type = $self->content_type // '';
+ return $content_type =~ m/html/io;
+}
+
=head3 html_content
my $wrapped_content = $message->html_content;
@@ -45,10 +59,14 @@ sub html_content {
my $title = $self->subject;
my $content = $self->content;
- my $css = C4::Context->preference("NoticeCSS") || '';
- $css = qq{} if $css;
- return <is_html ) {
+
+ my $css = C4::Context->preference("NoticeCSS") || '';
+ $css = qq{} if $css;
+
+ $wrapped = <
@@ -62,7 +80,12 @@ sub html_content {