https://github.com/envialosimple-dev/transaccional-php
PHP SDK for EnvíaloSimple Transaccional
https://github.com/envialosimple-dev/transaccional-php
email envialosimple library php sdk transactional
Last synced: 6 months ago
JSON representation
PHP SDK for EnvíaloSimple Transaccional
- Host: GitHub
- URL: https://github.com/envialosimple-dev/transaccional-php
- Owner: envialosimple-dev
- License: mit
- Created: 2023-11-23T15:39:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T17:53:52.000Z (about 1 year ago)
- Last Synced: 2026-01-14T14:14:45.781Z (6 months ago)
- Topics: email, envialosimple, library, php, sdk, transactional
- Language: PHP
- Homepage: https://envialosimple.com/transaccional
- Size: 45.9 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EnvíaloSimple Transaccional - PHP SDK
## Installation
```bash
composer require envialosimple/transaccional
```
## Basic Usage
```php
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('
HTML emails are cool, {{ name }}
')
->setText('Text emails are also cool, {{ name }}')
->setContext(['name' => 'John'])
;
$estr->mail->send($mailParams);
```
## Multiple Recipients Usage
```php
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('
HTML emails are cool, {{ name }}
')
->setText('Text emails are also cool, {{ name }}')
->setContext(['name' => 'John'])
;
$estr->mail->send($mailParams);
```