Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration of callback host from Rails controller #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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