mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Add warnings to notification email
This commit is contained in:
parent
0185866263
commit
82dbae58ee
@ -551,18 +551,30 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send notification to user
|
// Send notification to user
|
||||||
if($data['errors'])
|
if($data['warnings'] || $data['errors'])
|
||||||
{
|
{
|
||||||
$notify = new notifications();
|
$notify = new notifications();
|
||||||
$notify->set_sender($data['account_id']);
|
$notify->set_sender($data['account_id']);
|
||||||
$notify->add_receiver($data['account_id']);
|
$notify->add_receiver($data['account_id']);
|
||||||
$notify->set_subject(lang('Schedule import | export'). ' ' . lang('errors'));
|
$notify->set_subject(lang('Schedule import | export'). ' ' . lang('errors'));
|
||||||
|
|
||||||
$contents = lang($data['type']) . ' ' . lang('Errors') . ' ' . egw_time::to() . ':';
|
if($data['warnings'])
|
||||||
foreach($data['errors'] as $target => $errors)
|
|
||||||
{
|
{
|
||||||
$contents .= "\n". (is_numeric($target) ? '' : $target."\n");
|
$contents = lang($data['type']) . ' ' . lang('Warnings') . ' ' . egw_time::to() . ':';
|
||||||
$contents .= is_array($errors) ? implode("\n",$errors) : $errors;
|
foreach($data['warnings'] as $target => $message)
|
||||||
|
{
|
||||||
|
$contents .= "\n". (is_numeric($target) ? '' : $target."\n");
|
||||||
|
$contents .= is_array($message) ? implode("\n",$message) : $message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($data['errors'])
|
||||||
|
{
|
||||||
|
$contents = lang($data['type']) . ' ' . lang('Errors') . ' ' . egw_time::to() . ':';
|
||||||
|
foreach($data['errors'] as $target => $errors)
|
||||||
|
{
|
||||||
|
$contents .= "\n". (is_numeric($target) ? '' : $target."\n");
|
||||||
|
$contents .= is_array($errors) ? implode("\n",$errors) : $errors;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$notify->set_message($contents);
|
$notify->set_message($contents);
|
||||||
$notify->send();
|
$notify->send();
|
||||||
|
Loading…
Reference in New Issue
Block a user