diff --git a/lib/email/renderer.rb b/lib/email/renderer.rb index a22a72571ae..bb1768bd1b0 100644 --- a/lib/email/renderer.rb +++ b/lib/email/renderer.rb @@ -11,6 +11,7 @@ module Email def text return @text if @text @text = (@message.text_part ? @message.text_part : @message).body.to_s.force_encoding('UTF-8') + @text = CGI.unescapeHTML(@text) end def html @@ -28,4 +29,4 @@ module Email end end -end \ No newline at end of file +end diff --git a/spec/components/email/renderer_spec.rb b/spec/components/email/renderer_spec.rb new file mode 100644 index 00000000000..946f8585217 --- /dev/null +++ b/spec/components/email/renderer_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' +require 'email/renderer' + +describe Email::Renderer do + + let(:message) do + mail = Mail.new + + mail.text_part = Mail::Part.new do + body 'Key & Peele' + end + + mail.html_part = Mail::Part.new do + content_type 'text/html; charset=UTF-8' + body '