FIX : Show true error when send notify email at validate expense report
This commit is contained in:
parent
00ccb45bc4
commit
39cd4fcb9e
1 changed files with 8 additions and 3 deletions
|
|
@ -460,10 +460,15 @@ if (empty($reshook)) {
|
|||
setEventMessages($mesg, null, 'mesgs');
|
||||
} else {
|
||||
$langs->load("other");
|
||||
if ($mailfile->error) {
|
||||
if (!empty($mailfile->error) || !empty($mailfile->errors)) {
|
||||
$mesg = '';
|
||||
$mesg .= $langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
|
||||
$mesg .= '<br>'.$mailfile->error;
|
||||
$mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($emailFrom), dol_escape_htmltag($emailTo));
|
||||
if (!empty($mailfile->error)) {
|
||||
$mesg .= '<br>' . $mailfile->error;
|
||||
}
|
||||
if (!empty($mailfile->errors) && is_array($mailfile->errors)) {
|
||||
$mesg .= '<br>' . implode('<br>', $mailfile->errors);
|
||||
}
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
} else {
|
||||
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
|
||||
|
|
|
|||
Loading…
Reference in a new issue