Download the PHP package knplabs/knp-mailjet-bundle without Composer
On this page you can find all versions of the php package knplabs/knp-mailjet-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download knplabs/knp-mailjet-bundle
More information about knplabs/knp-mailjet-bundle
Files in knplabs/knp-mailjet-bundle
Package knp-mailjet-bundle
Short Description Symfony2 Bundle for initializing Mailjet PHP API wrapper and handling Event API callbacks
License MIT
Homepage https://github.com/KnpLabs/KnpMailjetBundle
Informations about the package knp-mailjet-bundle
DEPRECATED
Unfortunately we decided to not maintain this project anymore (see why). If you want to mark another package as a replacement for this one please send an email to [email protected].
KnpMailjetBundle
KnpMailjetBundle is a Symfony2 Bundle, mainly aimed at processing Mailjet Event Tracking API, but also provides service initialization for mailjet-api-php library.
Usage
RESTful API as a service
Add api/secret keys in config.yml
and it's up!
Now you can access RESTful API via DIC by calling knp_mailjet.api
service:
Event Tracking Listener
KnpMailjetBundle
handles Event Tracking API via EventListener service.
Configuring Mailjet
First, you need to provide Mailjet with a specific endpoint URL where all event callbacks will be sent. To do this, go to Event Tracking admin panel:
KnpMailjetBundle
provides a helper command that you can use to quickly dump current endpoint URL:
Configuring Event Listener
To actually handle events, you need to create your own Event Listener class by implementing provided interface Knp\Bundle\MailjetBundle\Event\Listener\EventListenerInterface
:
Now you need to configure it in DIC, but be sure to specify the tags you want to listen to:
And that's it, your endpoint is ready for Event Tracking API consumption!
If you don't know where to start with Event Listener implementation, take a look at the its configuration, which simply logs the events.
Securing Endpoint URL
It's a good idea to secure your endpoint URL with a special token that only you and Mailjet servers will know. That way you will avoid people abusing it should they discover.
With KnpMailjetBundle
it's really easy - just specify your desired token in config.yml
:
And now if you run the helper command you will see the secured URL:
Don't forget to update Mailjet admin panel with your new endpoint URL!
Installation
The first step to use KnpMailjetBundle
is to download Composer:
Now add KnpMailjetBundle
with Composer:
And that's it! Composer will automatically handle the rest.
Alternatively, you can manually add the dependency to composer.json
file...
... and then install our dependencies using:
After that, you need to update your app/AppKernel.php
file:
For Event Tracking API you also need to import routing:
And that's it!
Requirements
- PHP >= 5.3.8
- knplabs/mailjet-api-php
Contributing
See CONTRIBUTING.md file.
Running the Tests
To run unit tests, you'll need a set of dev dependencies you can install using Composer:
Once installed, just launch the following command:
Credits
Sponsored by
License
KnpMailjetBundle
is released under the MIT License. See the bundled LICENSE file for
details.
All versions of knp-mailjet-bundle with dependencies
symfony/framework-bundle Version ~2.3|~3.0
knplabs/mailjet-api-php Version 1.*