Skip to content

Conversation

@AMHOL
Copy link

@AMHOL AMHOL commented Apr 5, 2019

Intention

Allow for configuration of a custom callback host from Rails controller, this means we can decouple the handler methods from the controller.

Usage

class MyCustomCallbackHost
  def handle_hard_bounce(payload)
    # Do stuff with payload
  end
end

module Mandrill
  module Webhooks
    class InboxController < ApplicationController
      include Mandrill::Rails::WebHookProcessor

      ignore_unhandled_events!
      authenticate_with_mandrill_keys! 'YOUR_MANDRILL_WEBHOOK_KEY'
      callback_host(MyCustomCallbackHost.new)
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant