Compare commits

...

2 Commits

Author SHA1 Message Date
Dave Mc Nicoll
689c3203e7 Merge branch 'master' of https://git.mcnd.ca/mcndave/the-bugs into dev 2020-10-06 11:31:08 -04:00
Dave Mc Nicoll
b856ad1f94 - Fixed some function arguments 2020-10-06 11:29:38 -04:00

View File

@ -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;
}