Skip to content

Commit

Permalink
Message body parts should be a sub body (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
willpower232 authored and catphish committed Mar 13, 2023
1 parent 9b1ed1e commit d0db134
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/models/outgoing_message_prototype.rb
Expand Up @@ -160,17 +160,15 @@ def raw_message
mail.sender = @sender
mail.subject = @subject
mail.reply_to = @reply_to
if @html_body.blank? && attachments.empty?
mail.body = @plain_body
else
mail.part :content_type => "multipart/alternative" do |p|
if !@plain_body.blank?
mail.text_part = Mail::Part.new
mail.text_part.body = @plain_body
p.text_part = Mail::Part.new
p.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
p.html_part = Mail::Part.new
p.html_part.content_type = "text/html; charset=UTF-8"
p.html_part.body = @html_body
end
end
attachments.each do |attachment|
Expand Down

0 comments on commit d0db134

Please sign in to comment.