Saving Preordernotification and test email done

This commit is contained in:
Frank Schubert
2023-01-26 19:24:35 +01:00
parent 844e6ccd2a
commit d2ceb7ead8
14 changed files with 791 additions and 100 deletions

View File

@@ -7,6 +7,7 @@ class Emailnotification {
private $headers = [];
private $subject;
private $body;
private $html;
private $from_name = false;
private $email_from = false;
private $email_to = false;
@@ -52,6 +53,10 @@ class Emailnotification {
$this->body = $body;
}
public function setHtmlBody($html) {
$this->html = $html;
}
public function setFrom($email, $name = false) {
$this->email_from = $email;
$this->from_name = $name;
@@ -65,7 +70,7 @@ class Emailnotification {
if(!$this->email_to) {
return false;
}
if(!$this->body) {
if(!$this->body && !$this->html) {
return false;
}
if(!is_array($this->headers) || !count($this->headers)) {
@@ -93,8 +98,13 @@ class Emailnotification {
$mimeparams['head_charset']="utf-8";
$mime = new Mail_mime();
$mime->setTXTBody($this->body);
if($this->body) {
$mime->setTXTBody($this->body);
}
if($this->html) {
$mime->setHTMLBody($this->html);
}
//var_dump($this->attachments);exit;
if(count($this->attachments)) {