Merge pull request #3221 from ekoyle/add_web_html_email_option

Add web config option for HTML emails
This commit is contained in:
Daniel Preussker 2016-03-16 14:44:51 +00:00
commit 57339c4221
4 changed files with 7 additions and 1 deletions

View File

@ -178,6 +178,7 @@ $config['email_backend'] = 'mail'; // Mail backe
$config['email_from'] = NULL; // Mail from. Default: "ProjectName" <projectid@`hostname`>
$config['email_user'] = $config['project_id'];
$config['email_sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program.
$config['email_html'] = FALSE; // Whether to send HTML email as opposed to plaintext
$config['email_smtp_host'] = 'localhost'; // Outgoing SMTP server name.
$config['email_smtp_port'] = 25; // The port to connect.
$config['email_smtp_timeout'] = 10; // SMTP connection timeout in seconds.

View File

@ -248,6 +248,10 @@ $mail_conf = array(
'descr' => 'From email address',
'type' => 'text',
),
array('name' => 'email_html',
'descr' => 'Use HTML emails',
'type' => 'checkbox',
),
array('name' => 'email_sendmail_path',
'descr' => 'Sendmail path',
'type' => 'text',

View File

@ -21,4 +21,4 @@
* @subpackage Alerts
*/
return send_mail($obj['contacts'], $obj['title'], $obj['msg'], $opts['html'] ? true : false );
return send_mail($obj['contacts'], $obj['title'], $obj['msg'], ($config['email_html'] == 'true') ? true : false );

1
sql-schema/108.sql Normal file
View 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 ('email_html', 'false', 'false', 'Send HTML emails', 'alerting',0,'general',0,'0','0');