Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

when using html_body, set the content-type to text/html instead of th…

…e default text/plain
  • Loading branch information...
commit cec6c4c60555865a9499d902f91b35dbc8e93503 1 parent 57c1b77
@benprew benprew authored
Showing with 6 additions and 0 deletions.
  1. +1 −0  lib/pony.rb
  2. +5 −0 spec/pony_spec.rb
View
1  lib/pony.rb
@@ -61,6 +61,7 @@ def self.build_mail(options)
if options[:html_body]
html_part do
+ content_type 'text/html; charset=UTF-8'
body options[:html_body]
end
end
View
5 spec/pony_spec.rb
@@ -95,6 +95,11 @@
Pony.build_mail(:body => 'What do you know, Joe?').body.should == 'What do you know, Joe?'
end
+ it "html_body" do
+ Pony.build_mail(:html_body => 'What do you know, Joe?').parts.first.body.should == 'What do you know, Joe?'
+ Pony.build_mail(:html_body => 'What do you know, Joe?').parts.first.content_type.should == 'text/html; charset=UTF-8'
+ end
+
it "date" do
now = Time.now
Pony.build_mail(:date => now).date.should == DateTime.parse(now.to_s)
Please sign in to comment.
Something went wrong with that request. Please try again.