X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fmsg_template.pm;h=bef2b4b55dae591ca4384ddd5dfd30fd8e45836a;hb=5c68c43be829fd926ea148552c6bb87cdcafd7a1;hp=2f5e4762aa6235fd806fe92d6c3c58fac051bc5f;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm index 2f5e4762a..bef2b4b55 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 ); }