diff options
author | beardyman <nornholdj@gmail.com> | 2015-09-17 23:20:26 -0400 |
---|---|---|
committer | beardyman <nornholdj@gmail.com> | 2015-09-17 23:20:26 -0400 |
commit | efe48cc85e619768f69cd1d4843505bf9d146745 (patch) | |
tree | 9d0f5c7bae4a4d75745d30d969798a9c121155fd /lib/SendGridCompatibility/SendGrid.php | |
parent | b51ce2d0a8fad2577c164e1ab1c8382b1ae23fae (diff) | |
download | php-sparkpost-efe48cc85e619768f69cd1d4843505bf9d146745.zip php-sparkpost-efe48cc85e619768f69cd1d4843505bf9d146745.tar.gz php-sparkpost-efe48cc85e619768f69cd1d4843505bf9d146745.tar.bz2 |
Removed most static methods and adopted an instance based implementation. Updated all examples and compatibility later to reflect these changes.
Diffstat (limited to 'lib/SendGridCompatibility/SendGrid.php')
-rw-r--r-- | lib/SendGridCompatibility/SendGrid.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/SendGridCompatibility/SendGrid.php b/lib/SendGridCompatibility/SendGrid.php index a85337a..b92457b 100644 --- a/lib/SendGridCompatibility/SendGrid.php +++ b/lib/SendGridCompatibility/SendGrid.php @@ -1,22 +1,24 @@ <?php namespace SparkPost\SendGridCompatibility; -use SparkPost\Transmission; +use SparkPost\SparkPost; use SparkPost\SendGridCompatibility\Email; -use SparkPost\Configuration; class SendGrid{ - public function __construct($username, $password, $options = null) { + private $sparky; + + public function __construct($username, $password, $options = null, $httpAdapter) { //username isn't used in our system $opts = array('key'=>$password); if (!is_null($options)) { $opts = array_merge($opts, $options); } - Configuration::setConfig($opts); + + $this->sparky = new SparkPost($httpAdapter, $opts); } - + public function send(Email $email) { - Trasmission::send($email->toSparkPostTransmission()); + $this->sparky->transmission->send($email->toSparkPostTransmission()); } } -?>
\ No newline at end of file +?> |