error_log if calendar can not send notifications

This commit is contained in:
Ralf Becker 2016-10-06 19:07:48 +02:00
parent 7d189b9f46
commit c52c744346
2 changed files with 6 additions and 3 deletions

View File

@ -75,7 +75,7 @@ class Mailer extends Horde_Mime_Mail
if ($account !== false) if ($account !== false)
{ {
$this->_headers->setUserAgent('EGroupware API '.$GLOBALS['egw_info']['server']['versions']['phpgwapi']); $this->_headers->setUserAgent('EGroupware API '.$GLOBALS['egw_info']['server']['versions']['api']);
$this->setAccount($account); $this->setAccount($account);
@ -596,7 +596,7 @@ class Mailer extends Horde_Mime_Mail
if ($GLOBALS['egw_info']['server']['log_mail']) if ($GLOBALS['egw_info']['server']['log_mail'])
{ {
$msg = $GLOBALS['egw_info']['server']['log_mail'] !== true ? date('Y-m-d H:i:s')."\n" : ''; $msg = $GLOBALS['egw_info']['server']['log_mail'] !== true ? date('Y-m-d H:i:s')."\n" : '';
$msg .= (isset($e) ? 'Mail send' : 'Mail NOT send'). $msg .= (!isset($e) ? 'Mail send' : 'Mail NOT send').
' to '.implode(', ', $to).' with subject: "'.$subject.'"'; ' to '.implode(', ', $to).' with subject: "'.$subject.'"';
$msg .= ' from instance '.$GLOBALS['egw_info']['user']['domain'].' and IP '.Session::getuser_ip(); $msg .= ' from instance '.$GLOBALS['egw_info']['user']['domain'].' and IP '.Session::getuser_ip();

View File

@ -828,7 +828,6 @@ class calendar_boupdate extends calendar_bo
$event = $msg_type == MSG_ADDED || $msg_type == MSG_MODIFIED ? $new_event : $old_event; $event = $msg_type == MSG_ADDED || $msg_type == MSG_MODIFIED ? $new_event : $old_event;
// add all group-members to the notification, unless they are already participants // add all group-members to the notification, unless they are already participants
$contact_obj = false;
foreach($to_notify as $userid => $statusid) foreach($to_notify as $userid => $statusid)
{ {
if (is_numeric($userid) && $GLOBALS['egw']->accounts->get_type($userid) == 'g' && if (is_numeric($userid) && $GLOBALS['egw']->accounts->get_type($userid) == 'g' &&
@ -1047,6 +1046,10 @@ class calendar_boupdate extends calendar_bo
if(is_array($attachment)) { $notification->set_attachments(array($attachment)); } if(is_array($attachment)) { $notification->set_attachments(array($attachment)); }
$notification->send(); $notification->send();
foreach(notifications::errors(true) as $error)
{
error_log(__METHOD__."() Error notifying $userid from $senderid: $subject: $error");
}
} }
catch (Exception $exception) { catch (Exception $exception) {
error_log(__METHOD__.' error while notifying user '.$userid.':'.$exception->getMessage()); error_log(__METHOD__.' error while notifying user '.$userid.':'.$exception->getMessage());