ebf916af2e
I wanted to add a test for sending an attachment that is an empty string and a file but got this error: NoMethodError: undefined method `original_filename' for "#<Rack::Test::UploadedFile:0x000000010840d388>":String Related: #44702 Fixes #45088 ----- Started POST "/rails/conductor/action_mailbox/inbound_emails" for ::1 at 2022-05-14 07:34:19 +0200 Processing by Rails::Conductor::ActionMailbox::InboundEmailsController#create as HTML Parameters: {"authenticity_token"=>"[FILTERED]", "mail"=>{"from"=>"", "to"=>"", "cc"=>"", "bcc"=>"", "x_original_to"=>"", "in_reply_to"=>"", "subject"=>"", "body"=>"", "attachments"=>[""]}, "commit"=>"Deliver inbound email"} Completed 500 Internal Server Error in 7ms (ActiveRecord: 0.0ms | Allocations: 2600) NoMethodError (undefined method `original_filename' for "":String mail.add_file(filename: attachment.original_filename, content: attachment.read) ^^^^^^^^^^^^^^^^^^): actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:26:in `block (2 levels) in new_mail' actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `each' actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `block in new_mail' <internal:kernel>:90:in `tap' actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:23:in `new_mail' actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:17:in `create' Co-Authored-By: Patrício dos Santos <hello@psantos.dev> |
||
---|---|---|
.. | ||
app | ||
bin | ||
config | ||
db/migrate | ||
lib | ||
test | ||
.gitignore | ||
CHANGELOG.md | ||
MIT-LICENSE | ||
README.md | ||
Rakefile | ||
actionmailbox.gemspec |
README.md
Action Mailbox
Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.
The inbound emails are turned into InboundEmail
records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.
These inbound emails are routed asynchronously using Active Job to one or several dedicated mailboxes, which are capable of interacting directly with the rest of your domain model.
You can read more about Action Mailbox in the Action Mailbox Basics guide.
License
Action Mailbox is released under the MIT License.