diff options
author | George Claghorn <george.claghorn@gmail.com> | 2019-01-06 20:09:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 20:09:51 -0500 |
commit | 9cfcc067e626f0f1e220cc00a9f96622a936350d (patch) | |
tree | 8df66e792e1e71696f75980c8b0908e678e24327 /actionmailbox/app/controllers | |
parent | 1e09019088760adafaa122eb11c24effdb4c1160 (diff) | |
parent | 0419bc35047a62286961feb6e3e0177c9aa18cfa (diff) | |
download | rails-9cfcc067e626f0f1e220cc00a9f96622a936350d.tar.gz rails-9cfcc067e626f0f1e220cc00a9f96622a936350d.tar.bz2 rails-9cfcc067e626f0f1e220cc00a9f96622a936350d.zip |
Merge pull request #34886 from lsylvester/attachments-for-actionmailbox
add attachments to the new inbound mail
Diffstat (limited to 'actionmailbox/app/controllers')
-rw-r--r-- | actionmailbox/app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 30d6afe0c0..3537a983ef 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 @@ -20,7 +20,11 @@ module Rails private def new_mail - Mail.new params.require(:mail).permit(:from, :to, :cc, :bcc, :in_reply_to, :subject, :body).to_h + Mail.new(params.require(:mail).permit(:from, :to, :cc, :bcc, :in_reply_to, :subject, :body).to_h).tap do |mail| + params[:mail][:attachments].to_a.each do |attachment| + mail.attachments[attachment.original_filename] = { filename: attachment.path, content_type: attachment.content_type } + end + end end def create_inbound_email(mail) |