From 3bd35e47db036cd68eb91b59dd1826f8296db8f9 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 28 Jan 2015 22:05:07 -0500 Subject: [PATCH] #106 / #126 Add new settings to modsForHesk_settings.inc.php and update script --- install/updateTo2-0-0.php | 38 ++++++++++++++++++++++++++++++++++++ modsForHesk_settings.inc.php | 10 +++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/install/updateTo2-0-0.php b/install/updateTo2-0-0.php index a8b64fdb..34e5fba1 100644 --- a/install/updateTo2-0-0.php +++ b/install/updateTo2-0-0.php @@ -18,8 +18,46 @@ if (hesk_dbNumRows($keyRs) == 0) hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` ADD KEY `statuses` (`status`)"); } +//-- Add the new HTML email property to modsForHesk_settings.inc.php +$file = file_get_contents(HESK_PATH . 'modsForHesk_settings.inc.php'); + +//-- Only add the additional settings if they aren't already there. +if (strpos($file, 'html_emails') !== true) +{ + $file .= ' + +//-- Set this to 1 to enable HTML-formatted emails. +$modsForHesk_settings[\'html_emails\'] = 0; + +//-- Mailgun Settings +$modsForHesk_settings[\'use_mailgun\'] = 0; +$modsForHesk_settings[\'mailgun_api_key\'] = \'API Key\'; +$modsForHesk_settings[\'mailgun_domain\'] = \'mail.domain.com\';'; +} + +if (!file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file)) +{ + $updateSuccess = false; + echo '

Failure!

+

An issue occurred when trying to update the modsForHesk_settings.inc.php file.

+
+

Add the following lines to your modsForHesk_settings.inc.php file:

+
+ //-- Set this to 1 to enable HTML-formatted emails. + $modsForHesk_settings[\'html_emails\'] = 0;

+ //-- Mailgun Settings + $modsForHesk_settings[\'use_mailgun\'] = 0; + $modsForHesk_settings[\'mailgun_api_key\'] = \'API Key\'; + $modsForHesk_settings[\'mailgun_domain\'] = \'mail.domain.com\'; + +

After editing your modsForHesk_settings.inc.php file, you can follow the instructions below.'; + +} + $banRS = hesk_dbQuery("SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_emails` UNION ALL SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_ips`"); + +$banRows = hesk_dbNumRows($banRS); if (hesk_dbNumRows($banRS) > 0) { $usersRS = hesk_dbQuery("SELECT `id`, `name` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` WHERE `active` = '1' ORDER BY `name`"); diff --git a/modsForHesk_settings.inc.php b/modsForHesk_settings.inc.php index 2541aa65..0245a289 100644 --- a/modsForHesk_settings.inc.php +++ b/modsForHesk_settings.inc.php @@ -23,4 +23,12 @@ $modsForHesk_settings['show_icons'] = 0; $modsForHesk_settings['custom_field_setting'] = 0; //-- Set this to 1 to enable email verification for new customers -$modsForHesk_settings['customer_email_verification_required'] = 0; \ No newline at end of file +$modsForHesk_settings['customer_email_verification_required'] = 0; + +//-- Set this to 1 to enable HTML-formatted emails. +$modsForHesk_settings['html_emails'] = 0; + +//-- Mailgun Settings +$modsForHesk_settings['use_mailgun'] = 0; +$modsForHesk_settings['mailgun_api_key'] = 'API Key'; +$modsForHesk_settings['mailgun_domain'] = 'mail.domain.com'; \ No newline at end of file