mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Copy all email alerts to default contact (#8178)
* feature: Copy all email alerts to default contact * change in SQL and add check as requested * Rename 233.sql to 234.sql * tab removing
This commit is contained in:
@@ -281,6 +281,10 @@ $general_conf = array(
|
||||
'descr' => 'Send alerts to default contact only',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array('name' => 'alert.default_copy',
|
||||
'descr' => 'Copy all email alerts to default contact',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array('name' => 'alert.default_mail',
|
||||
'descr' => 'Default contact',
|
||||
'type' => 'text',
|
||||
|
@@ -317,6 +317,11 @@ function GetContacts($results)
|
||||
}
|
||||
}
|
||||
|
||||
# Copy all email alerts to default contact if configured.
|
||||
if (!isset($tmp_contacts[$config['alert']['default_mail']]) && ($config['alert']['default_copy'])) {
|
||||
$tmp_contacts[$config['alert']['default_mail']] = '';
|
||||
}
|
||||
|
||||
# Send email to default contact if no other contact found
|
||||
if ((count($tmp_contacts) == 0) && ($config['alert']['default_if_none']) && (!empty($config['alert']['default_mail']))) {
|
||||
$tmp_contacts[$config['alert']['default_mail']] = '';
|
||||
|
1
sql-schema/234.sql
Normal file
1
sql-schema/234.sql
Normal file
@@ -0,0 +1 @@
|
||||
INSERT INTO `config` (`config_name`,`config_value`,`config_default`,`config_descr`,`config_group`,`config_group_order`,`config_sub_group`,`config_sub_group_order`,`config_hidden`,`config_disabled`) VALUES ('alert.default_copy','true','true','Copy all email alerts to default contact','alerting',0,'general',0,'0','0');
|
Reference in New Issue
Block a user