Merge pull request #3885 from laf/issue-3860

Added support for multiple emails
This commit is contained in:
Tony Murray
2016-07-28 16:46:49 -05:00
committed by GitHub
2 changed files with 21 additions and 1 deletions

View File

@@ -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

View File

@@ -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;
}