Download the PHP package knplabs/mailjet-api-php without Composer
On this page you can find all versions of the php package knplabs/mailjet-api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download knplabs/mailjet-api-php
More information about knplabs/mailjet-api-php
Files in knplabs/mailjet-api-php
Package mailjet-api-php
Short Description Mailjet PHP API client
License MIT
Homepage https://github.com/KnpLabs/mailjet-api-php
Informations about the package mailjet-api-php
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].
mailjet-api-php
mailjet-api-php
is a PHP library for quick and simple consuming of Mailjet API.
It supports both RESTful and Event Tracking APIs.
Usage
RESTful API - OOP wrappers
This library provides OOP wrappers to most (all) API endpoints, that are located under Mailjet/Api/Request
namespace. These include:
- Api related calls
- User related calls
Simple example:
RESTful API - Client
In addition to using wrappers, you can obviously also use the client directly to make API requests on lower level. To ease consumption of RESTful API there's a RequestApi helper class, which lists all available queries. Check Mailjet documentation for a detailed list of queries.
Simple example:
Sending a POST request:
Event Tracking API
mailjet-api-php
provides a clean OOP interface to interact with Event Tracking API.
Note: this library is not responsible for validation of incoming data. However, assuming the data is coming from Mailjet servers, it will work correctly.
Symfony2 integration
You don't need a special bundle to use the RESTful API with Symfony2, you can initialize the service with a simple config:
And that's it, Mailjet RESTful API is now available via:
And to initialize higher level OOP wrappers:
However, if you need both RESTful and Event API support, then there's KnpMailjetBundle.
Installation
The first step to use mailjet-api-php
is to download Composer:
Now add mailjet-api-php
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:
Requirements
- PHP >= 5.3.8
- HTTP component of Guzzle library
- (optional) Symfony2 Debug Component
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
OOP wrappers idea was originally implemented by David Guyon in his version of the client.
Sponsored by
License
mailjet-api-php is released under the MIT License. See the bundled LICENSE file for details.