aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/action_mailbox/ingresses/sendgrid/inbound_emails_controller.rb
blob: 0b9e2e1866112811677f766381f201adac8898bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class ActionMailbox::Ingresses::Sendgrid::InboundEmailsController < ActionMailbox::BaseController
  cattr_accessor :username, default: "actionmailbox"
  cattr_accessor :password

  before_action :authenticate

  def create
    ActionMailbox::InboundEmail.create_and_extract_message_id! raw_email
    head :no_content
  end

  private
    def raw_email
      StringIO.new params.require(:email)
    end
end