blastengine / blastengine
This library sends email quickly using blastengine API.
Installs: 2 282
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^9
- yamadashy/phpstan-friendly-formatter: ^1.0
README
PHP SDK for blastengine is SDK for sending email using blastengine.
Usage
Initialize
Blastengine\Client::initialize($your_user_id, $your_api_key);
Send transaction email
$transaction = new Blastengine\Transaction(); $transaction ->to($this->config["to"]) ->from($this->config["from"]["email"]) ->subject('Test subject') ->text_part('This is test email'); try { $transaction->send(); } catch ( Exception $ex ) { // Error }
Send transaction email with attachments
$transaction = new Blastengine\Transaction(); $transaction ->to($this->config["to"]) ->from($this->config["from"]["email"]) ->subject('Test subject') ->text_part('This is test email') ->attachment('/path/to/image') ->attachment('/path/to/another'); try { $transaction->send(); } catch ( Exception $ex ) { // Error }
Get email info
$transaction = new Blastengine\Transaction(); $transaction->delivery_id(100); $transaction->get(); echo $transaction->delivery_type // => TRANSACTION
You can access other information below.
https://blastengine.jp/documents/#operation/delivery-detail-get
Test
All test
vendor/bin/phpunit
Specific test
vendor/bin/phpunit --filter testEmail
PHPStan
./vendor/bin/phpstan analyze --error-format friendly
This SDK is PHPStan level 7.
License
MIT.