blastengine/blastengine

This library sends email quickly using blastengine API.

v0.0.9 2024-04-18 07:37 UTC

This package is auto-updated.

Last update: 2024-04-18 07:37:37 UTC


README

PHP SDK for blastengine is SDK for sending email using blastengine.

https://blastengine.jp/

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

License

MIT.