Commit 3bfd93e8 by Denis Chenu

[fix] Error when saving token log

parent a675c044
...@@ -803,19 +803,26 @@ class sendMailCron extends \ls\pluginmanager\PluginBase ...@@ -803,19 +803,26 @@ class sendMailCron extends \ls\pluginmanager\PluginBase
if(!$this->simulate){ if(!$this->simulate){
if($sType=='invite'){ if($sType=='invite'){
$oToken->sent=dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust")); $oToken->sent=dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"));
$txtLog="sent set to ".$oToken->sent;
} }
if($sType=='remind'){ if($sType=='remind'){
$oToken->remindersent=dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust")); $oToken->remindersent=dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"));
$oToken->remindercount++; $oToken->remindercount++;
$txtLog="remindersent set to ".$oToken->remindersent." count:".$oToken->remindercount;
}
if($oToken->save()) {
$this->sendMailCronLog("Email {$oToken->email} : $txtLog",3);
} else {
$error=CVarDumper::dumpAsString($oToken->getErrors(), 3, false);
$this->sendMailCronLog("Email {$oToken->email} error: $error");
} }
$oToken->save();
} }
}else{ }else{
$sTo=implode(";",$aTo); $sTo=implode(";",$aTo);
if($maildebug){ if($maildebug){
$this->sendMailCronLog("Unknow error when send email to {$sTo} ({$iSurvey}) : ".$maildebug); $this->sendMailCronLog("Unknow error when send email to {$oToken->email} ({$iSurvey}) : ".$maildebug);
}else{ }else{
$this->sendMailCronLog("Unknow error when send email to {$sTo} ({$iSurvey})"); $this->sendMailCronLog("Unknow error when send email to {$oToken->email} ({$iSurvey})");
} }
$aCountMail['error']++; $aCountMail['error']++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment