From ce88f6bd2561f3ff31e39c70ae82b301ee0ddd79 Mon Sep 17 00:00:00 2001 From: Kyle Keesling Date: Thu, 25 Jul 2019 16:24:04 -0400 Subject: Fix filenames of attachments created via the inbound email conductor controller passed along attachment file paths instead of their filenames --- .../rails/conductor/action_mailbox/inbound_emails_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailbox/app/controllers/rails') diff --git a/actionmailbox/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb b/actionmailbox/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb index 8713f545f5..cd8b12dcde 100644 --- a/actionmailbox/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb +++ b/actionmailbox/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb @@ -23,7 +23,7 @@ module Rails 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 -- cgit v1.2.3