Skip to content

hampel/symfonymailer-sparkpost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony Mailer SparkPost Driver

Latest Version on Packagist Total Downloads Open Issues License

By Simon Hampel

Description

Standalone implementation of Symfony Mailer SparkPost Driver based on https://github.com/gam6itko/sparkpost-mailer - but using GuzzleHttp as the HTTP client rather than Symfony HTTP Client.

Installation

You can install the package via composer:

composer require hampel/symfonymailer-sparkpost

Usage

The SparkPost options available are defined in the API: SparkPost options

$sparkpostOptions = [
	'options' => [
		'open_tracking' => false,
		'click_tracking' => true,
		'transactional' => true,
	],
];

$transport = new SparkPostApiTransport(
	'MYSPARKPOSTAPIKEY', 
	new GuzzleHttp\Client
);

new SparkPostEmail();
$email->setOptions([
    'click_tracking' => false,
    'open_tracking' => true,
    'transactional' => true,
]);
$email->setCampaignId('my-campaign');
$email->from('[email protected]');
$email->to('[email protected]');
$email->subject('My subject');
$email->text(...);
$email->html(...);

$result = $transport->send($email);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages