summaryrefslogtreecommitdiff
path: root/FS/FS/msg_template.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-08-23 15:24:24 -0700
committerMark Wells <mark@freeside.biz>2013-08-23 15:24:24 -0700
commit5c68c43be829fd926ea148552c6bb87cdcafd7a1 (patch)
treeb3a7b9cb965197b56ac67d673a332b37f3039cd6 /FS/FS/msg_template.pm
parenta9a791f0e93cf43f93a4bd720c7681d08d84f18c (diff)
pass correct arguments to msg_template::prepare, #24659
Diffstat (limited to 'FS/FS/msg_template.pm')
-rw-r--r--FS/FS/msg_template.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index 2f5e476..bef2b4b 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -16,6 +16,7 @@ use Date::Format qw( time2str );
use HTML::Entities qw( decode_entities encode_entities ) ;
use HTML::FormatText;
use HTML::TreeBuilder;
+use Encode;
use File::Temp;
use IPC::Run qw(run);
@@ -410,6 +411,10 @@ sub prepare {
# @cust_msg = ('cust_msg' => $cust_msg);
# }
+ my $text_body = encode('UTF-8',
+ HTML::FormatText->new(leftmargin => 0, rightmargin => 70)
+ ->format( HTML::TreeBuilder->new_from_content($body) )
+ );
(
'custnum' => $cust_main->custnum,
'msgnum' => $self->msgnum,
@@ -418,8 +423,7 @@ sub prepare {
'bcc' => $self->bcc_addr || undef,
'subject' => $subject,
'html_body' => $body,
- 'text_body' => HTML::FormatText->new(leftmargin => 0, rightmargin => 70
- )->format( HTML::TreeBuilder->new_from_content($body) ),
+ 'text_body' => $text_body
);
}