Skip to content
Snippets Groups Projects

Devel

Merged Piotr Potrebka requested to merge devel into main
5 files
+ 33
26
Compare changes
  • Side-by-side
  • Inline

Files

+ 23
13
@@ -9,42 +9,42 @@ class Email {
/**
* @var array
*/
private $recipients = [];
private array $recipients = [];
/**
* @var string
*/
private $subject = '';
private string $subject = '';
/**
* @var array
*/
private $attachments = [];
private array $attachments = [];
/**
* @var string
*/
private $content = '';
private string $content = '';
/**
* @var array
*/
private $headers = [ 'Content-Type' => 'text/html' ];
private array $headers = [ 'Content-Type' => 'text/html' ];
/**
* @var string
*/
private $from_email;
private string $from_email;
/**
* @var string
*/
private $from_name;
private string $from_name;
/**
* @var array
*/
private $template_attributes;
private array $template_attributes;
/**
* @param string $from_email
@@ -106,7 +106,7 @@ class Email {
*
* @return self
*/
public function set_recipients( array $recipients = [] ): self {
public function set_recipients( array $recipients ): self {
$this->recipients = $recipients;
return $this;
@@ -162,9 +162,11 @@ class Email {
}
/**
* @return string
* @param $type
*
* @return Email
*/
public function set_content_type( $type = 'html' ): self {
public function set_content_type( $type ): self {
switch ( $type ) {
case 'plain':
$content_type = 'text/plain';
@@ -200,12 +202,20 @@ class Email {
return $this->content;
}
public function set_template_attributes( string $name, string $value ): self {
$this->template_attributes[ $name ] = $value;
/**
* @param array $template_attributes
*
* @return $this
*/
public function set_template_attributes( array $template_attributes ): self {
$this->template_attributes= $template_attributes;
return $this;
}
/**
* @return array
*/
public function get_template_attributes(): array {
return $this->template_attributes;
}
Loading