LeKoala\Mandrill\MandrillController
Provide extensions points for handling the webhook
- Author: LeKoala <thomas@lekoala.be>
Synopsis
class MandrillController
extends Controller
{
- // constants
- const EVENT_SEND = 'send';
- const EVENT_HARD_BOUNCE = 'hard_bounce';
- const EVENT_SOFT_BOUNCE = 'soft_bounce';
- const EVENT_OPEN = 'open';
- const EVENT_CLICK = 'click';
- const EVENT_SPAM = 'spam';
- const EVENT_UNSUB = 'unsub';
- const EVENT_REJECT = 'reject';
- const EVENT_INBOUND = 'inbound';
- const EVENT_WHITELIST = 'whitelist';
- const EVENT_BLACKLIST = 'blacklist';
- // members
- protected integer $eventsCount = 0;
- protected integer $skipCount = 0;
- private static array $allowed_actions = ;
- private static boolean $webhook_auth_enabled = false;
- private static array $dependencies = ;
- public LoggerInterface $logger;
- // methods
- public HTTPResponse incoming()
- protected void handleAnyEvent()
- protected void handleSyncEvent()
- protected void handleInboundEvent()
- protected void handleMessageEvent()
- public LoggerInterface getLogger()
- public string getWebHookKey()
- protected string generateSignature()
Hierarchy
Extends
- SilverStripe\Control\Controller
Constants
Name | Value |
---|---|
EVENT_SEND | 'send' |
EVENT_HARD_BOUNCE | 'hard_bounce' |
EVENT_SOFT_BOUNCE | 'soft_bounce' |
EVENT_OPEN | 'open' |
EVENT_CLICK | 'click' |
EVENT_SPAM | 'spam' |
EVENT_UNSUB | 'unsub' |
EVENT_REJECT | 'reject' |
EVENT_INBOUND | 'inbound' |
EVENT_WHITELIST | 'whitelist' |
EVENT_BLACKLIST | 'blacklist' |
Members
private
- $allowed_actions
- $dependencies
—
array
Inject public dependencies into the controller - $webhook_auth_enabled
protected
- $eventsCount
- $skipCount
public
- $logger — Psr\Log\LoggerInterface
Methods
protected
- generateSignature() — generates signature to verify request is from mailchimp.
- handleAnyEvent()
- handleInboundEvent()
- handleMessageEvent()
- handleSyncEvent()
public
- getLogger() — Get logger
- getWebHookKey() — returns the webhook key
- incoming() — Handle incoming webhook