2017 © Pedro Peláez
 

library mailjet-apiv3-php

PHP 5.3 wrapper for the Mailjet API

image

amosoft/mailjet-apiv3-php

PHP 5.3 wrapper for the Mailjet API

  • Thursday, March 1, 2018
  • by AMOSoft
  • Repository
  • 3 Watchers
  • 0 Stars
  • 684 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 48 Forks
  • 0 Open issues
  • 19 Versions
  • 3 % Grown

The README.md

alt text, (*1)

Codacy Badge Build Status MIT License Current Version, (*2)

Mailjet API Client, compatible with the old PHP 5.3., (*3)

Check out all the resources and all the PHP code examples on the official documentation: Maijlet Documentation, (*4)

Requirements

PHP >= 5.3, (*5)

Installation

``` bash composer require AMOSoft/mailjet-apiv3-php, (*6)


## Getting Started ! [grab][api_credential] and save your Mailjet API credentials. It will create some variables available in your code, via the `getenv` function: ``` bash export MJ_APIKEY_PUBLIC='your api key' export MJ_APIKEY_PRIVATE='your api secret'

Initialize your Mailjet Client:, (*7)

``` php , (*8)

It's as easy as 1, 2, 3 !


## Make your first call

``` php
get(Resources::$Contact);

/*
  Read the response
*/
if ($response->success())
  var_dump($response->getData());
else
  var_dump($response->getStatus());

```

### [Filtering resources](http://dev.mailjet.com/guides/?php#filtering-resources)

The [Mailjet][mailjet] API provides a set of general filters that can be applied to a GET request for each resource. In addition to these general filters, each API resource has its own filters that can be used when performing the GET

``` php
 '150'];

$response = $mj->get(Resources::$Contact, ['filters' => $filters]);

```

### [Send transactional emails](http://dev.mailjet.com/guides/?php#send-transactional-email)

``` php
 "pilot@mailjet.com",
    'FromName' => "Mailjet Pilot",
    'Subject' => "Your email flight plan!",
    'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
    'Html-part' => "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!", 'Recipients' => [['Email' => "passenger@mailjet.com"]] ]; $response = $mj->post(Resources::$Email, ['body' => $body]); ``` ### [Send marketing campaign](http://dev.mailjet.com/guides/?php#send-marketing-campaigns) To send your first newsletter, you need to have at least one active sender address in the Sender domains & addresses section. ``` php [ [ 'Email' => "mailjet@example.org", 'Name' => "Mailjet" ] ] ]; $response = $mj->post(Resources::$NewsletterTest, ['id' => $id, 'body' => $body]); ?>

Event API - real time notifications

The Event API offer a real-time notification through http request on any events related to the messages you sent. The main supported events are open, click, bounce, spam, blocked, unsub and sent. This event notification works for transactional and marketing emails., (*9)

The endpoint is an URL our server will call for each event (it can lead to a lot of hits !). You can use the API to setup a new endpoint using the /eventcallbackurl resource. Alternatively, you can configure this in your account preferences, in the Event Tracking section., (*10)

``` php <?php, (*11)

$body = [ 'EventType' => "open", 'Url' => "https://mydomain.com/event_handler" ];, (*12)

$response = $mj->post(Resources::$Eventcallbackurl, ['body' => $body]);, (*13)


### [Statistics](http://dev.mailjet.com/guides/?php#statistics) The [Mailjet][mailjet] API offers resources to extracts information for every messages you send. You can also filter through the message statistics to view specific metrics for your messages. ``` php <?php $response = $mj->get(Resources::$Message, ['id' => $id]);

Parse API - Inbound emails

The Parse API allows you to have inbound emails parsed and their content delivered to a webhook of your choice. In order to begin receiving emails to your webhook, create a new instance of the Parse API via a POST request on the /parseroute resource., (*14)

``` php <?php, (*15)

$body = [ 'Url' => 'https://www.mydomain.com/mj_parse.php' ];, (*16)

$response = $mj->post(Resources::$Parseroute, ['body' => $body]);, (*17)

```, (*18)

Send a pull request

  • Fork the project.
  • Create a topic branch.
  • Implement your feature or bug fix.
  • Add documentation for your feature or bug fix.
  • Add specs for your feature or bug fix.
  • Commit and push your changes.
  • Submit a pull request. Please do not include changes to the gemspec, or version file.

The Versions

01/03 2018

dev-master

9999999-dev https://github.com/AMOSoft/mailjet-apiv3-php

PHP 5.3 wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

The Development Requires

api email php v3 mailjet

18/01 2017

v1.2.0

1.2.0.0 https://github.com/AMOSoft/mailjet-apiv3-php

PHP 5.3 wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

The Development Requires

api email php v3 mailjet

22/04 2016

v1.1.2

1.1.2.0 https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

The Development Requires

api email php v3 mailjet

18/03 2016

v1.1.1

1.1.1.0 https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

10/02 2016

v1.1.0

1.1.0.0 https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

28/01 2016

dev-feature/add_setter_for_API_url_protocol

dev-feature/add_setter_for_API_url_protocol https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

22/12 2015

v1.0.3

1.0.3.0 https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

21/12 2015

dev-readme

dev-readme https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

30/11 2015

dev-validate

dev-validate https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

26/11 2015

dev-nocomposer

dev-nocomposer https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

25/11 2015

dev-style

dev-style https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

24/11 2015

dev-dist

dev-dist https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

23/11 2015

v1.0.2

1.0.2.0 https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

23/11 2015

dev-naming_conflict

dev-naming_conflict https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

16/11 2015

dev-fix

dev-fix https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

16/11 2015

v1.0.1

1.0.1.0 https://github.com/mailjet/mailjet-apiv3-php/

PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet

12/11 2015

v1.0.0

1.0.0.0 https://github.com/mailjet/mailjet-apiv3-php/

[API v3] PHP wrapper for the Mailjet API

  Sources   Download

MIT

The Requires

 

api email php v3 mailjet