envialosimple/transaccional

PHP SDK for EnvíaloSimple Transaccional

v0.0.5 2024-02-16 16:17 UTC

This package is auto-updated.

Last update: 2024-09-16 17:39:41 UTC


README

EnvíaloSimple Transaccional - PHP SDK

Installation

composer require envialosimple/transaccional

Basic Usage

use EnvialoSimple\Transaccional;
use EnvialoSimple\Transaccional\Helpers\Builder\MailParams;

$estr = new Transaccional($your_api_key);

$mailParams = new MailParams();

$mailParams
    ->setFrom('no-reply@mycompany.com', 'MyCompany Notifications')
    ->setTo('john.doe@example.com', 'John Doe')
    ->setReplyTo('do-reply@mycompany.com')
    ->setPreviewText('A glimpse of what comes next...')
    ->setSubject('This is a subject')
    ->setHtml('<h1>HTML emails are cool, {{ name }}</h1>')
    ->setText('Text emails are also cool, {{ name }}')
    ->setContext(['name' => 'John'])
    ;

$estr->mail->send($mailParams);