- Fixed some function arguments

This commit is contained in:
Dave Mc Nicoll 2020-10-06 11:29:38 -04:00
parent a7dcdf4ee7
commit b856ad1f94
1 changed files with 14 additions and 2 deletions

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