Sha256: d64f10e0806d0333f0344dbefcca6e4384f7f7976df98eaf872ac355bb1059a6

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

require_dependency "ishapi/application_controller"

module Ishapi
  class EmailMessagesController < ApplicationController

    def receive
      if params[:secret] != AWS_SES_LAMBDA_SECRET
        render status: 400, json: { status: 400 }
        return
      end

      msg = Office::EmailMessage.new({
        object_path: params[:object_path],
        object_key: params[:object_key],
      })
      if msg.save
        render status: :ok, json: { status: :ok }
      else
        render status: 400, json: { status: 400 }
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ishapi-0.1.8.212 app/controllers/ishapi/email_messages_controller.rb
ishapi-0.1.8.211 app/controllers/ishapi/email_messages_controller.rb