Skip to content
Snippets Groups Projects

Devel

Merged Piotr Potrebka requested to merge devel into main
6 files
+ 82
10
Compare changes
  • Side-by-side
  • Inline

Files

+ 12
3
@@ -11,8 +11,9 @@ abstract class EmailAbstract implements EmailInterface {
*/
private $renderer;
public function __construct( Renderer $renderer ) {
$this->renderer = $renderer;
public function __construct( Renderer $renderer, array $recipients ) {
$this->renderer = $renderer;
$this->recipients = $recipients;
}
/**
@@ -37,6 +38,10 @@ abstract class EmailAbstract implements EmailInterface {
* @return string
*/
public function get_subject(): string {
if ( ! $this->subject ) {
throw new \Exception( 'Empty email subject' );
}
return '';
}
@@ -55,7 +60,7 @@ abstract class EmailAbstract implements EmailInterface {
* @return string[]
*/
public function get_recipients(): array {
return [];
return $this->recipients;
}
/**
@@ -91,6 +96,10 @@ abstract class EmailAbstract implements EmailInterface {
* @return string
*/
public function get_content(): string {
if ( ! $this->content ) {
throw new \Exception( 'Empty email subject' );
}
return '';
}
Loading