From 1329fecac47f059bf7a4ac2d0ed585e75e3f1735 Mon Sep 17 00:00:00 2001 From: James Adams Date: Wed, 26 Aug 2020 10:26:46 +0100 Subject: [PATCH] Read send_email from config file and act appropriately --- lib/Gocdb_Services/NotificationService.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Gocdb_Services/NotificationService.php b/lib/Gocdb_Services/NotificationService.php index 01da40653..eccc3f242 100644 --- a/lib/Gocdb_Services/NotificationService.php +++ b/lib/Gocdb_Services/NotificationService.php @@ -125,6 +125,15 @@ private function get_webPortalURL() { } + /** + * Return whether send_email is enabled in the config file + */ + private function get_config_send_email() { + $localInfoXML = simplexml_load_file(__DIR__ . "/../../config/local_info.xml"); + return strtolower($localInfoXML->local_info->send_email) === 'true'; + } + + private function mock_mail($to, $subject, $message, $additional_headers = "", $additional_parameters = "") { echo "