FIX can edit reminders on past events

This commit is contained in:
Laurent Destailleur 2023-12-21 14:35:40 +01:00
parent f9f3d3a6e1
commit 450cbbb76d

View file

@ -2497,7 +2497,7 @@ class ActionComm extends CommonObject
//Select all action comm reminders
$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
$sql .= " WHERE typeremind = 'email'";
$sql .= " AND status <= 0"; // 0=No yet sent, -1=Error
$sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
$sql .= " AND dateremind <= '".$this->db->idate($now)."'";
$sql .= " AND entity IN (".getEntity('actioncomm').")";
$sql .= $this->db->order("dateremind", "ASC");
@ -2568,7 +2568,7 @@ class ActionComm extends CommonObject
if ($cMailFile->sendfile()) {
$nbMailSend++;
} else {
$errormesg = $cMailFile->error.' : '.$to;
$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.join(',', $cMailFile->errors);
$error++;
}
}