envialosimple / transaccional
PHP SDK for EnvíaloSimple Transaccional
Installs: 47
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/envialosimple/transaccional
Requires
- php: >=7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.39
- phpunit/phpunit: ^10
- vlucas/phpdotenv: ^5.6
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);
Multiple Recipients 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([ ["email" => 'john.doe@example.com', "name" => 'John Doe'], ["email" => 'jane.doe@example.com', "name" => 'Jane Doe'], ["email" => 'sean.doe@example.com'] ]) ->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);