- Work on SwiftMailer interface
This commit is contained in:
parent
689c3203e7
commit
bee7e25935
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue