iturri/mail-sdk

Iturri mail gateway SDK for PHP projects

1.0.14 2025-06-30 16:31 UTC

This package is not auto-updated.

Last update: 2025-09-08 22:48:02 UTC


README

This is a SDK for PHP projects that provides a friendly and easy interface to integrate your application with the IturriMail mailing gateway API.

This library provides a wrapper for the available API objects and a client to perform the requests.

Installation

$ composer require iturri/mail-sdk

Usage

The basic usage of the library is:


// importing the libraries
use IturriMail\EmailSender\Attach\Attach,
IturriMail\EmailSender\Email\EmailAddress,
IturriMail\EmailSender\EmailSender,
IturriMail\EmailSender\Templates,
IturriMail\IturriMail;
// creating a new IturriMail client instance
$iturriMail = IturriMail::factory();

// configuring the client
$iturriMail->setSender(new EmailAddress('ghiancorx@gmail.com', 'GhianCo Zapata'))
->setSubject('Asunto')
->setPathTemplate(app()::$root . '/templates/vb/concluido.html')
->setTemplate('DOCUMENT_BODY')
#Way 1
->setReceiver(new EmailAddress('ghiancorx@gmail.com', 'GhianCo 1'))
#Way 2
->setReceiver([['name'=> 'GhianCo 2','email'=>'ghiancorx@gmail.com']])
->setCC([['name'=> 'GhianCo 3','email'=>'ghiancorx@gmail.com']]);

$emailSender = new EmailSender();
// ... configuring the transaction object
$anyData = new stdClass;
$anyData->ot = 'OT Num 1';
$anyData->bl = 'Bl';
$anyData->cliente = 'Cliente';
$anyData->regimen = 'Regimen';
$emailSender->setBinding($anyData);

$emailSender->setAttach(new Attach('server/archivos/9328e4cfa53b9596f1e055ba31952399.png', 'Filename', "https://localhost/project"));
// performing the transaction
$response = $iturriMail->doSend($emailSender);

// check if the mail is sending
$response->isSuccess();

API and Developers Documentation

Soon

Tests

$ composer install --dev
$ ./vendor/bin/phpunit

License

This library is licensed under the MIT License.