Skip to content
Snippets Groups Projects
Commit 457afb90 authored by Will Power's avatar Will Power Committed by Adam Cooke
Browse files

don't create empty parts in a multi part email (#267)

parent f1bee564
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -163,11 +163,15 @@ class OutgoingMessagePrototype
if @html_body.blank? && attachments.empty?
mail.body = @plain_body
else
mail.text_part = Mail::Part.new
mail.text_part.body = @plain_body
mail.html_part = Mail::Part.new
mail.html_part.content_type = "text/html; charset=UTF-8"
mail.html_part.body = @html_body
if !@plain_body.blank?
mail.text_part = Mail::Part.new
mail.text_part.body = @plain_body
end
if !@html_body.blank?
mail.html_part = Mail::Part.new
mail.html_part.content_type = "text/html; charset=UTF-8"
mail.html_part.body = @html_body
end
end
attachments.each do |attachment|
mail.attachments[attachment[:name]] = {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment