Skip to content

Commit

Permalink
don't get mailer during init
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Mar 28, 2024
1 parent 6488774 commit aad12fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SparkPostHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use SilverStripe\Core\Config\Configurable;
use LeKoala\SparkPost\Api\SparkPostApiClient;
use Symfony\Component\Mailer\MailerInterface;
use SilverStripe\Core\Injector\InjectorNotFoundException;

/**
* This configurable class helps decoupling the api client from SilverStripe
Expand Down Expand Up @@ -243,7 +244,6 @@ public static function getWebhookPassword()
public static function registerTransport()
{
$client = self::getClient();
$mailer = self::getMailer();
$transport = new SparkPostApiTransport($client);
$mailer = new Mailer($transport);
Injector::inst()->registerService($mailer, MailerInterface::class);
Expand Down

0 comments on commit aad12fc

Please sign in to comment.