Fix for emails with empty body

This commit is contained in:
Neil Lalonde 2013-07-24 15:07:43 -04:00
parent 2319a824f8
commit e0b9117f15
2 changed files with 4 additions and 2 deletions

View File

@ -7,7 +7,9 @@ module Email
builder = Email::MessageBuilder.new(*builder_args)
headers(builder.header_args) if builder.header_args.present?
mail(builder.build_args).tap { |message|
message.html_part = builder.html_part if message
if message and h = builder.html_part
message.html_part = h
end
}
end
end

View File

@ -39,7 +39,7 @@ module Email
end
end
@message.parts[0].body = @message.parts[0].body.to_s.gsub!(/\[\/?email-indent\]/, '')
@message.parts[0].body = @message.parts[0].body.to_s.gsub(/\[\/?email-indent\]/, '')
@message.text_part.content_type = 'text/plain; charset=UTF-8'