From 6b7eac5c51cbef4acd1ab7f48884e7b614f71678 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Sat, 6 Oct 2018 22:02:08 -0400 Subject: Accept inbound emails from a variety of ingresses --- config/routes.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 733f137262..dea6cbd659 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,14 @@ # frozen_string_literal: true Rails.application.routes.draw do - post "/rails/action_mailbox/inbound_emails" => "action_mailbox/inbound_emails#create", as: :rails_inbound_emails + scope "/rails/action_mailbox" do + post "/amazon/inbound_emails" => "action_mailbox/ingresses/amazon/inbound_emails#create", as: :rails_amazon_inbound_emails + post "/postfix/inbound_emails" => "action_mailbox/ingresses/postfix/inbound_emails#create", as: :rails_postfix_inbound_emails + post "/sendgrid/inbound_emails" => "action_mailbox/ingresses/sendgrid/inbound_emails#create", as: :rails_sendgrid_inbound_emails + + # Mailgun requires that the webhook's URL end in 'mime' for it to receive the raw contents of emails. + post "/mailgun/inbound_emails/mime" => "action_mailbox/ingresses/mailgun/inbound_emails#create", as: :rails_mailgun_inbound_emails + end # TODO: Should these be mounted within the engine only? scope "rails/conductor/action_mailbox/", module: "rails/conductor/action_mailbox" do -- cgit v1.2.3 From 3984460424b678d844009319598e2b41c350ca3c Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Wed, 17 Oct 2018 00:12:03 -0400 Subject: Add Mandrill support --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index dea6cbd659..4a337dcc5c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,6 +5,7 @@ Rails.application.routes.draw do post "/amazon/inbound_emails" => "action_mailbox/ingresses/amazon/inbound_emails#create", as: :rails_amazon_inbound_emails post "/postfix/inbound_emails" => "action_mailbox/ingresses/postfix/inbound_emails#create", as: :rails_postfix_inbound_emails post "/sendgrid/inbound_emails" => "action_mailbox/ingresses/sendgrid/inbound_emails#create", as: :rails_sendgrid_inbound_emails + post "/mandrill/inbound_emails" => "action_mailbox/ingresses/mandrill/inbound_emails#create", as: :rails_mandrill_inbound_emails # Mailgun requires that the webhook's URL end in 'mime' for it to receive the raw contents of emails. post "/mailgun/inbound_emails/mime" => "action_mailbox/ingresses/mailgun/inbound_emails#create", as: :rails_mailgun_inbound_emails -- cgit v1.2.3 From b5ada0de68aadc7da0c6ffabf496dc35d300daa9 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Wed, 17 Oct 2018 08:51:34 -0400 Subject: Alphabetize --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 4a337dcc5c..95dee7696c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,9 +3,9 @@ Rails.application.routes.draw do scope "/rails/action_mailbox" do post "/amazon/inbound_emails" => "action_mailbox/ingresses/amazon/inbound_emails#create", as: :rails_amazon_inbound_emails + post "/mandrill/inbound_emails" => "action_mailbox/ingresses/mandrill/inbound_emails#create", as: :rails_mandrill_inbound_emails post "/postfix/inbound_emails" => "action_mailbox/ingresses/postfix/inbound_emails#create", as: :rails_postfix_inbound_emails post "/sendgrid/inbound_emails" => "action_mailbox/ingresses/sendgrid/inbound_emails#create", as: :rails_sendgrid_inbound_emails - post "/mandrill/inbound_emails" => "action_mailbox/ingresses/mandrill/inbound_emails#create", as: :rails_mandrill_inbound_emails # Mailgun requires that the webhook's URL end in 'mime' for it to receive the raw contents of emails. post "/mailgun/inbound_emails/mime" => "action_mailbox/ingresses/mailgun/inbound_emails#create", as: :rails_mailgun_inbound_emails -- cgit v1.2.3 From f8c0ddcf016661f9c508e71224d7722409ef0cec Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Wed, 17 Oct 2018 08:53:37 -0400 Subject: Extract module scope --- config/routes.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 95dee7696c..f1bc9847f5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,14 +1,14 @@ # frozen_string_literal: true Rails.application.routes.draw do - scope "/rails/action_mailbox" do - post "/amazon/inbound_emails" => "action_mailbox/ingresses/amazon/inbound_emails#create", as: :rails_amazon_inbound_emails - post "/mandrill/inbound_emails" => "action_mailbox/ingresses/mandrill/inbound_emails#create", as: :rails_mandrill_inbound_emails - post "/postfix/inbound_emails" => "action_mailbox/ingresses/postfix/inbound_emails#create", as: :rails_postfix_inbound_emails - post "/sendgrid/inbound_emails" => "action_mailbox/ingresses/sendgrid/inbound_emails#create", as: :rails_sendgrid_inbound_emails + scope "/rails/action_mailbox", module: "action_mailbox/ingresses" do + post "/amazon/inbound_emails" => "amazon/inbound_emails#create", as: :rails_amazon_inbound_emails + post "/mandrill/inbound_emails" => "mandrill/inbound_emails#create", as: :rails_mandrill_inbound_emails + post "/postfix/inbound_emails" => "postfix/inbound_emails#create", as: :rails_postfix_inbound_emails + post "/sendgrid/inbound_emails" => "sendgrid/inbound_emails#create", as: :rails_sendgrid_inbound_emails - # Mailgun requires that the webhook's URL end in 'mime' for it to receive the raw contents of emails. - post "/mailgun/inbound_emails/mime" => "action_mailbox/ingresses/mailgun/inbound_emails#create", as: :rails_mailgun_inbound_emails + # Mailgun requires that a webhook's URL end in 'mime' for it to receive the raw contents of emails. + post "/mailgun/inbound_emails/mime" => "mailgun/inbound_emails#create", as: :rails_mailgun_inbound_emails end # TODO: Should these be mounted within the engine only? -- cgit v1.2.3 From 88227658217ee82af7516d6a8013a6c04f037073 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Wed, 17 Oct 2018 09:53:02 -0400 Subject: Nest --- config/routes.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index f1bc9847f5..99a15d1d32 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,7 +13,8 @@ Rails.application.routes.draw do # TODO: Should these be mounted within the engine only? scope "rails/conductor/action_mailbox/", module: "rails/conductor/action_mailbox" do - resources :inbound_emails, as: :rails_conductor_inbound_emails - post ":inbound_email_id/reroute" => "reroutes#create", as: :rails_conductor_inbound_email_reroute + resources :inbound_emails, as: :rails_conductor_inbound_emails do + post "reroute" => "reroutes#create" + end end end -- cgit v1.2.3