未验证 提交 3d23c6fa 编写于 作者: R Rafael França 提交者: Rafael Mendonça França

Merge pull request #36765 from kylekeesling/patch-1

fix filenames of attachments created via the inbound email conductor
上级 8f9183cb
......@@ -23,7 +23,7 @@ def new_mail
Mail.new(params.require(:mail).permit(:from, :to, :cc, :bcc, :in_reply_to, :subject, :body).to_h).tap do |mail|
mail[:bcc]&.include_in_headers = true
params[:mail][:attachments].to_a.each do |attachment|
mail.add_file(filename: attachment.path, content: attachment.read)
mail.add_file(filename: attachment.original_filename, content: attachment.read)
end
end
end
......
......@@ -43,8 +43,10 @@ class Rails::Conductor::ActionMailbox::InboundEmailsControllerTest < ActionDispa
end
mail = ActionMailbox::InboundEmail.last.mail
attachment_filenames = mail.attachments.map(&:filename)
assert_equal "Let's talk about these images:", mail.text_part.decoded
assert_equal 2, mail.attachments.count
assert_equal attachment_filenames, ["avatar1.jpeg", "avatar2.jpeg"]
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册