Skip to content

blastengineMania/blastengine-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP SDK for blastengine

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published