- Fixed some function arguments
This commit is contained in:
parent
a7dcdf4ee7
commit
b856ad1f94
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue