- Work on SwiftMailer interface
This commit is contained in:
1 parent
689c3203e7
commit
bee7e25935
1 file changed
+12
-3
@@ -8,11 +8,13 @@ class SwiftMailer implements MailerInterface
|
|||||||
|
|
||||||
protected $transport;
|
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) {
|
public function __construct(EmailConfiguration $configuration) {
|
||||||
$this->emailConfiguration = $configuration;
|
$this->emailConfiguration = $configuration;
|
||||||
@@ -28,6 +30,7 @@ class SwiftMailer implements MailerInterface
|
|||||||
->setFrom( $this->from )
|
->setFrom( $this->from )
|
||||||
->setTo( $this->to )
|
->setTo( $this->to )
|
||||||
->setCC($this->cc ?? [])
|
->setCC($this->cc ?? [])
|
||||||
|
->setBCC($this->bcc ?? [])
|
||||||
->setBody( $message, $html ? 'text/html' : 'text/plain' );
|
->setBody( $message, $html ? 'text/html' : 'text/plain' );
|
||||||
|
|
||||||
return ( new \Swift_Mailer($this->transport) )->send($swiftObj);
|
return ( new \Swift_Mailer($this->transport) )->send($swiftObj);
|
||||||
@@ -54,4 +57,10 @@ class SwiftMailer implements MailerInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setBCC(/*stringable|array*/ $bcc) : MailerInterface
|
||||||
|
{
|
||||||
|
$this->bcc = $bcc;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user