FEATURE: add handle_mail admin route

you can post full email payloads to this endpoint /admin/email/handle_mail
This commit is contained in:
Sam 2015-10-19 08:33:24 +11:00
parent b117c2541d
commit dc859beff3
2 changed files with 7 additions and 0 deletions

View file

@ -38,6 +38,12 @@ class Admin::EmailController < Admin::AdminController
render json: MultiJson.dump(html_content: renderer.html, text_content: renderer.text)
end
def handle_mail
params.require(:email)
Email::Receiver.new(params[:email]).process
render text: "email was processed"
end
private
def filter_email_logs(email_logs, params)

View file

@ -120,6 +120,7 @@ Discourse::Application.routes.draw do
get "sent"
get "skipped"
get "preview-digest" => "email#preview_digest"
post "handle_mail"
end
end