Added newline after html body in Preordernotification Email

This commit is contained in:
Frank Schubert
2024-12-02 13:48:15 +01:00
parent e013deb655
commit a4dbe91ecd
2 changed files with 17 additions and 2 deletions

View File

@@ -20,8 +20,11 @@ class Preordernotification extends mfBaseModel {
public function sendToPreorder(Preorder $preorder, $email_to = false) {
$subject = $this->subject;
$body = $this->replaceBodyVariables($this->body_html, $preorder); // TODO: Variable replacement
$body = "<html><head></head><body>";
$body .= $this->replaceBodyVariables($this->body_html, $preorder); // TODO: Variable replacement
$body .= "</body></html>";
$body .= "\n"; // explicitlyadd new line, or some mail clients wont show attachment
// TODO: Extract text part
//var_dump($body);exit;

View File

@@ -441,10 +441,22 @@ class PreordernotificationController extends mfBaseController {
if($r->send_testmail && $r->testmail_to) {
$preorder = PreorderModel::getFirstActive($preorder_filter);
if($this->attach_borderpoint) {
$i = 1;
while(!$preorder->adb_hausnummer->gps_lat && !$preorder->adb_hausnummer->gps_long) {
$this->log->debug(__METHOD__.": round $i");
$preorder = PreorderModel::searchActive($preorder_filter, ["start" => $i, "count" => 1]);
if(!$preorder) break;
$i++;
}
}
if(!$preorder) {
$this->layout()->setFlash("Testmail konnte nicht versendet werden. Keine Empfänger gefunden", "warn");
$this->redirect("Preordernotification", "edit", ['id' => $new_id]);
}
$notification->sendToPreorder($preorder, $r->testmail_to);
$this->layout()->setFlash("Test Email erfolgreich versendet", "success");
$this->redirect("Preordernotification", "edit", ['id' => $new_id]);