2017 © Pedro Peláez
 

symfony-bundle mailhookbundle

A bundle to catch API webhook from differents mail service

image

scullwm/mailhookbundle

A bundle to catch API webhook from differents mail service

  • Thursday, July 19, 2018
  • by ScullWM
  • Repository
  • 3 Watchers
  • 31 Stars
  • 3,208 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

MailHookBundle

Catch webhook from various API mail service and directly get the related user., (*1)

Build Status Build Status, (*2)

Features

Define your project url to your mail provider service (Mandrill, MailJet...) and get events dispatched into your app., (*3)

Support various service

  • Campain Monitor
  • Mailgun
  • Mailjet
  • Mandrill
  • Sendgrid
  • Sparkpost
  • And add your custom service

Example use cases:

  • Disable to a user's notification when a mail is signal as spam.
  • Send a private message to a user if last mail send get bounced.
  • Warning an Account Manager about a hard bounce on a new user creation.
  • Track email reading and clicks on your custom CRM.
  • All you want!

Installation

Add the package to your composer.json file, (*4)

"scullwm/mailhookbundle": "dev-master",

Add this to app/AppKernel.php, (*5)

<?php
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Swm\Bundle\MailHookBundle\SwmMailHookBundle(),
        );

        ...

        return $bundles;
    }

Configuration

1) Edit app/config.yml

swm_mail_hook:
    secretsalt: notSecret

2) Edit app/routing.yml

swm_mailhook_controller:
    resource: "@SwmMailHookBundle/Controller/"
    type:     annotation
    prefix:   /

Well done!, (*6)

Use it

Go to your email service provider like mandrillapp.com and find where to configure your webhook. Check hooks you want and set the url like this:, (*7)

http://www.mywebsite.com/webhook/{secretSalt}/{serviceName}/catch, (*8)

With no configuration for mandrill it should be : http://www.mywebsite.com/webhook/notSecret/mandrill/catch, (*9)

With a custom secretSalt and mailjet service it should be : http://www.mywebsite.com/webhook/dDifXo26/mailjet/catch, (*10)

Events dispatched

  • swm.mail_hook.event.open
  • swm.mail_hook.event.send
  • swm.mail_hook.event.click
  • swm.mail_hook.event.soft_bounce
  • swm.mail_hook.event.hard_bounce
  • swm.mail_hook.event.deferral
  • swm.mail_hook.event.spam
  • swm.mail_hook.event.blocked
  • swm.mail_hook.event.unsub
  • swm.mail_hook.event.reject
  • swm.mail_hook.event.other

Events listener provided

By default, a simple MailHookEvent is dispatched by the DefaultHydrator. But if you are using FosUserBundle, you can use the FosUserHydrator to use directly UserMailHookEvent which return directly the user entity associate on the email., (*11)

If your using FosUserBundle

There's already a special route called "swm_mailhook_user_catcher_for_service": /{secretSalt}/{service}/catchuser, (*12)

It directly return a UserMailHookEvent where you can getUser()., (*13)

To see a basic exemple see this link : https://gist.github.com/ScullWM/8acea9c0e229ed76717f (Using JMS/di-extra-bundle optionnal), (*14)

The Versions

19/07 2018

dev-master

9999999-dev http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet sparkpost

19/07 2018

v2.2

2.2.0.0 http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet sparkpost

17/07 2018

v2.1

2.1.0.0 http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet sparkpost

21/12 2017

v2.0

2.0.0.0 http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet sparkpost

02/05 2017

v1.1

1.1.0.0 http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet sparkpost

21/04 2017

v1.0

1.0.0.0 http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet sparkpost

08/01 2017

v0.1

0.1.0.0 http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet

29/05 2015

dev-atoum

dev-atoum http://github.com/ScullWM/MailHookBundle

A bundle to catch API webhook from differents mail service

  Sources   Download

MIT

The Requires

 

The Development Requires

api mail hook bundle symfony mandrill webhook mailjet