PHP code example of lukaszaleckas / mailpigeon-client-php

1. Go to this page and download the library: Download lukaszaleckas/mailpigeon-client-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lukaszaleckas / mailpigeon-client-php example snippets


use MailPigeon\MailPigeonClient;
use MailPigeon\MailPigeonApi;
use MailPigeon\DTOs\Request\SendEmailDto;

$client = new MailPigeonClient('<your provider secret / api key here>');
$api    = new MailPigeonApi($client);

$api->sendEmail(
    new SendEmailDto(
       'Jon Doe',
       '[email protected]',
       '<your campaign identifier here>',
       'en',
       [
           'some' => 'variable',
       ]
    )
);