/maildrop-php

Maildrop's Official SDK for PHP

Primary LanguagePHPMIT LicenseMIT

Maildrop PHP client

Installation

The SDK is available on Packagist. To install it, you will need to be using Composer in your project.

composer require maildrop/maildrop-php

Usage

You should always use Composer autoloader in your application to automatically load your dependencies. All the examples below assume you've already included this in your file:

require 'vendor/autoload.php';
use Maildrop\Maildrop;

Here's how to add a contact to one of your contact list using the SDK:

// First, instantiate the SDK with the ClientApiKey of one of your account
// See https://doc.maildrop.fr/-t44.html#Trouver_ClientApiKey to find the right ClientApiKey
Maildrop::setDefaultClientApiKey("client-apikey");

$md = new Maildrop();

// Now, add a new contact to a contact list
$md->subscribers()->add([
    'listid' => 'a7fb155366727c500406344b5f196f3a',
    'email'  => 'jack@example.com'
]);

All usage examples

You will find more examples in the /examples directory in this repo.

You will find more documentation at /doc and on https://doc.maildrop.fr.