Added Sender to Preordernotification
This commit is contained in:
@@ -15,8 +15,12 @@ class Preordernotification extends mfBaseModel {
|
||||
public function sendToPreorder(Preorder $preorder, $email_to) {
|
||||
$subject = $this->subject;
|
||||
$body = $this->body_html; // TODO: Variable replacement
|
||||
$from = "office@xinon.at";
|
||||
$from_name = "XINON Kundenservice";
|
||||
$from = $this->sender_email;
|
||||
$from_name = $this->sender_name;
|
||||
$reply_to = null;
|
||||
if($this->sender_replyto) {
|
||||
$reply_to = $this->sender_replyto;
|
||||
}
|
||||
$to = $preorder->email;
|
||||
|
||||
if($email_to) {
|
||||
@@ -46,7 +50,10 @@ class Preordernotification extends mfBaseModel {
|
||||
$email->setHtmlBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-".MFAPPNAME."-Pnid", $this->id);
|
||||
if($reply_to) {
|
||||
$email->setHeader("Reply-To", $reply_to);
|
||||
}
|
||||
$email->setHeader("X-".ucfirst(MFAPPNAME)."-Pnid", $this->id);
|
||||
if(count($attachments)) {
|
||||
foreach($attachments as $file) {
|
||||
$email->addAttachment($file["path"], null, $file["filename"], $file['mimetype']);
|
||||
|
||||
@@ -234,6 +234,9 @@ class PreordernotificationController extends mfBaseController {
|
||||
//var_dump($filter);
|
||||
$data = [];
|
||||
$data['preordercampaign_id'] = $campaign_id;
|
||||
$data['sender_email'] = $r->sender_email;
|
||||
$data['sender_name'] = $r->sender_name;
|
||||
$data['sender_replyto'] = $r->sender_replyto;
|
||||
$data['subject'] = $r->subject;
|
||||
$data['body_html'] = $r->body_html;
|
||||
$data['note'] = $r->note;
|
||||
@@ -371,7 +374,7 @@ class PreordernotificationController extends mfBaseController {
|
||||
$this->redirect("Preordernotification", "edit", ['id' => $new_id]);
|
||||
}
|
||||
$notification->sendToPreorder($preorder, $r->testmail_to);
|
||||
$this->layout()->setFlash("Testmail versendet", "success");
|
||||
$this->layout()->setFlash("Test Email erfolgreich versendet", "success");
|
||||
$this->redirect("Preordernotification", "edit", ['id' => $new_id]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user