aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-12-24 15:16:22 -0500
committerGeorge Claghorn <george@basecamp.com>2018-12-25 21:32:35 -0500
commita5b2fff64ca0c1fa7be5124f40a251d991c10a85 (patch)
tree33a79841402b7151e52d9ad3949ce54f320c10aa /actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb
parent4298df00ae6219b9b5b7c40f281d4fa4d66f4383 (diff)
parentdcddff1d2d0c695318670686a27429a76f20ae03 (diff)
downloadrails-a5b2fff64ca0c1fa7be5124f40a251d991c10a85.tar.gz
rails-a5b2fff64ca0c1fa7be5124f40a251d991c10a85.tar.bz2
rails-a5b2fff64ca0c1fa7be5124f40a251d991c10a85.zip
Import Action Mailbox
Diffstat (limited to 'actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb')
-rw-r--r--actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb b/actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb
new file mode 100644
index 0000000000..c53203049b
--- /dev/null
+++ b/actionmailbox/app/controllers/rails/conductor/action_mailbox/reroutes_controller.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# 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