Added Preordertype legacytransfer + moved createWorkorder to Rimoapi
This commit is contained in:
@@ -60,19 +60,35 @@ class MaintenanceNotification extends mfBaseModel {
|
||||
$mnlog->save();
|
||||
}
|
||||
|
||||
$this->sent = date("U");
|
||||
$this->save();
|
||||
|
||||
|
||||
// send to xinon
|
||||
$mnlog = MaintenanceNotificationLog::getFirst(["maintenancenotification_id" => $this->id, "email" => "internal-email"]);
|
||||
if($mnlog) {
|
||||
// was sent already
|
||||
return true;
|
||||
}
|
||||
|
||||
$to = "wartungsverteiler.team@xinon.at";
|
||||
$body .= "\n\nPLZ Liste:\n\n";
|
||||
$body .= implode("\n", $this->getProperty("plzs"));
|
||||
$email = new Emailnotification();
|
||||
$email->setSubject($subject);
|
||||
$email->setHtmlBody($body);
|
||||
$email->setBody($body);
|
||||
$email->setFrom($from, $from_name);
|
||||
$email->setTo($to);
|
||||
$email->setHeader("X-".ucfirst(MFAPPNAME)."-mnid", $this->id);
|
||||
$email->send();
|
||||
$this->log->info(__METHOD__.": Sending MaintenanceNotification to $to");
|
||||
|
||||
$mnlog = MaintenanceNotificationLog::create([
|
||||
"maintenancenotification_id" => $this->id,
|
||||
"email" => "internal-email",
|
||||
"sent" => date("U"),
|
||||
]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user