From eed061776ab38bd428122199a621df3a3a3e77b8 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Tue, 26 Jul 2022 17:35:16 +0200 Subject: [PATCH] Some improvements erpapi mail --- www/lib/class.erpapi.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index 06739830..b97bb23e 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -29773,7 +29773,7 @@ function ChargenMHDAuslagern($artikel, $menge, $lagerplatztyp, $lpid,$typ,$wert, */ // Force only existing emailbackup accounts - $tpl = ""; +// $tpl = ""; $email_addr = $this->app->DB->SelectArr("SELECT email, angezeigtername FROM emailbackup WHERE email != '' AND (adresse<=0 OR adresse='".$this->app->User->GetAdresse()."') AND geloescht!=1 ORDER BY email"); @@ -32456,10 +32456,16 @@ function ChargenMHDAuslagern($artikel, $menge, $lagerplatztyp, $lpid,$typ,$wert, return $this->MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files,$projekt,$signature,$cc,$bcc, $system); } +/* +* Return 0 = not ok, return 1 = ok +*/ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$projekt="",$signature=true,$cc="",$bcc="", $system = false) { // keine leeren email versenden - if($text=="" && $betreff=="") return; + if($text=="" && $betreff=="") { + $this->mail_error = "Mailer Error: " . "Empty mail."; + return 0; + } /* $isSystemTemplate = $system && is_file(dirname(__DIR__, 2) .'/classes/Modules/Company/templates/systemmail.tpl'); if($isSystemTemplate) {