From bee7e25935f41b415869d4a915d575a2cd496463 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 6 Jan 2021 19:32:56 +0000 Subject: [PATCH] - Work on SwiftMailer interface --- src/Email/SwiftMailer.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Email/SwiftMailer.php b/src/Email/SwiftMailer.php index 6dee0fa..cca9b3c 100644 --- a/src/Email/SwiftMailer.php +++ b/src/Email/SwiftMailer.php @@ -8,11 +8,13 @@ class SwiftMailer implements MailerInterface protected $transport; - protected $from; + protected /*stringable*/ $from; - protected $to; + protected /*stringable|array*/ $to; - protected $cc; + protected /*stringable|array*/ $cc; + + protected /*stringable|array*/ $bcc; public function __construct(EmailConfiguration $configuration) { $this->emailConfiguration = $configuration; @@ -28,6 +30,7 @@ class SwiftMailer implements MailerInterface ->setFrom( $this->from ) ->setTo( $this->to ) ->setCC($this->cc ?? []) + ->setBCC($this->bcc ?? []) ->setBody( $message, $html ? 'text/html' : 'text/plain' ); return ( new \Swift_Mailer($this->transport) )->send($swiftObj); @@ -54,4 +57,10 @@ class SwiftMailer implements MailerInterface return $this; } + public function setBCC(/*stringable|array*/ $bcc) : MailerInterface + { + $this->bcc = $bcc; + + return $this; + } } \ No newline at end of file