From 5fddf09581a5f60e06c0cd716f1a89f891552f63 Mon Sep 17 00:00:00 2001 From: Thomas de Jesus Date: Fri, 31 Mar 2017 10:43:05 -0500 Subject: [PATCH] Update Suggestion.php Sends email upon submitted suggestion. This can probably be written better, like maybe on a successful save, but I was not sure where that would go. Also, just used sendmail instead of swiftmailer, so that could also be changed --- mod/calendar/class/Suggestion.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mod/calendar/class/Suggestion.php b/mod/calendar/class/Suggestion.php index 96334473a..1e14c2722 100644 --- a/mod/calendar/class/Suggestion.php +++ b/mod/calendar/class/Suggestion.php @@ -147,6 +147,13 @@ public function save() $this->schedule_id = $this->_schedule->id; $this->submitted = time(); $db = new PHPWS_DB('calendar_suggestions'); + $to = PHPWS_Settings::get('calendar', 'cal_manager'); + $subject = "Suggested Calendar Event"; + $txt = "A new Calendar Event has been submitted"; + $headers = "From: foo@bar.com" . "\r\n" . //Needs to be set Could be an additional setting or commented out completely + "CC: yada.yada.com"; // Same + + mail($to,$subject,$txt,$headers); return $db->saveObject($this); }