mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #3885 from laf/issue-3860
Added support for multiple emails
This commit is contained in:
@@ -192,6 +192,11 @@ $config['alert']['admins'] = true; //Include Administrators into alert-contacts
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
For all but the default contact, we support setting multiple email addresses separated by a comma. So you can
|
||||
set the devices sysContact, override the sysContact or have your users emails set like:
|
||||
|
||||
`email@domain.com, alerting@domain.com`
|
||||
|
||||
E-Mail transport is enabled with adding the following to your `config.php`:
|
||||
~
|
||||
```php
|
||||
|
||||
@@ -281,5 +281,20 @@ function GetContacts($results) {
|
||||
$contacts[$user['email']] = $user['realname'];
|
||||
}
|
||||
}
|
||||
return $contacts;
|
||||
|
||||
$tmp_contacts = array();
|
||||
foreach ($contacts as $email => $name) {
|
||||
if (strstr($email, ',')) {
|
||||
$split_contacts = preg_split("/[,\s]+/", $email);
|
||||
foreach ($split_contacts as $split_email) {
|
||||
if(!empty($split_email)) {
|
||||
$tmp_contacts[$split_email] = $name;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tmp_contacts[$email] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
return $tmp_contacts;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user