1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb
David Heinemeier Hansson 6edccec1b9 Basic docs for most classes
2018-12-12 16:34:05 -08:00

15 lines
518 B
Ruby

# Rerouting will run routing and processing on an email that has already been, or attempted to be, processed.
class Rails::Conductor::ActionMailbox::ReroutesController < Rails::Conductor::BaseController
def create
inbound_email = ActionMailbox::InboundEmail.find(params[:inbound_email_id])
reroute inbound_email
redirect_to main_app.rails_conductor_inbound_email_url(inbound_email)
end
private
def reroute(inbound_email)
inbound_email.pending!
inbound_email.route_later
end
end