From b856ad1f945d06639919b03d435ab17269cfc8e4 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 6 Oct 2020 11:29:38 -0400 Subject: [PATCH] - Fixed some function arguments --- src/Email/SwiftMailer.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Email/SwiftMailer.php b/src/Email/SwiftMailer.php index 8bb4013..6dee0fa 100644 --- a/src/Email/SwiftMailer.php +++ b/src/Email/SwiftMailer.php @@ -12,6 +12,8 @@ class SwiftMailer implements MailerInterface protected $to; + protected $cc; + public function __construct(EmailConfiguration $configuration) { $this->emailConfiguration = $configuration; @@ -25,20 +27,30 @@ class SwiftMailer implements MailerInterface $swiftObj = ( new \Swift_Message($subject) ) ->setFrom( $this->from ) ->setTo( $this->to ) + ->setCC($this->cc ?? []) ->setBody( $message, $html ? 'text/html' : 'text/plain' ); return ( new \Swift_Mailer($this->transport) )->send($swiftObj); } - public function setFrom($from) : MailerInterface + public function setFrom(/*stringable|array*/ $from) : MailerInterface { $this->from = $from; + return $this; } - public function setTo($to) : MailerInterface + public function setTo(/*stringable|array*/ $to) : MailerInterface { $this->to = $to; + + return $this; + } + + public function setCC(/*stringable|array*/ $cc) : MailerInterface + { + $this->cc = $cc; + return $this; }