From 0c32f3ba98692b81881095eed269e40b621ab77f Mon Sep 17 00:00:00 2001 From: Eric Rosas Date: Mon, 7 Oct 2024 14:42:22 -0700 Subject: [PATCH 1/2] Added contact-form.php config file Added contact-form.php config file --- api/config/contact-form.php | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 api/config/contact-form.php diff --git a/api/config/contact-form.php b/api/config/contact-form.php new file mode 100644 index 00000000..3523c457 --- /dev/null +++ b/api/config/contact-form.php @@ -0,0 +1,43 @@ +request; + +// 'toEmail' => 'bond@007.com', // override this one with env vars + +if (!$request->getIsConsoleRequest()) { + $topic = $request->getBodyParam("topic"); + $to_list = null; + + if($topic != null) { + switch($topic) { + case "website_feedback": + $to_list = "eric.rosas@noirlab.edu;ericdrosas@gmail.com"; + break; + case "general": + $to_list = "erosas@lsst.org;ericdrosas@gmail.com"; + break; + case "education": + $to_list = "agoff@lsst.org;ericdrosas@gmail.com"; + break; + case "media": + $to_list = "alexandra.goff@noirlab.edu;ericdrosas@gmail.com"; + break; + case "site_visit": + $to_list = "ericdrosas@gmail.com"; + break; + default: + $to_list = "ericdrosas@gmail.com"; + break; + } + + Craft::info("to_list : $to_list", "Maddie"); + return [ + 'toEmail' => $to_list + ]; + } + +} + + From 77c484282564dc60732ba49f25673fdc450b97aa Mon Sep 17 00:00:00 2001 From: Eric Rosas Date: Mon, 7 Oct 2024 14:46:46 -0700 Subject: [PATCH 2/2] Changed semicolans to commas for email lists Changes semicolans to commas for email lists --- api/config/contact-form.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/config/contact-form.php b/api/config/contact-form.php index 3523c457..28505050 100644 --- a/api/config/contact-form.php +++ b/api/config/contact-form.php @@ -13,16 +13,16 @@ if($topic != null) { switch($topic) { case "website_feedback": - $to_list = "eric.rosas@noirlab.edu;ericdrosas@gmail.com"; + $to_list = "eric.rosas@noirlab.edu,ericdrosas@gmail.com"; break; case "general": - $to_list = "erosas@lsst.org;ericdrosas@gmail.com"; + $to_list = "erosas@lsst.org,ericdrosas@gmail.com"; break; case "education": - $to_list = "agoff@lsst.org;ericdrosas@gmail.com"; + $to_list = "agoff@lsst.org,ericdrosas@gmail.com"; break; case "media": - $to_list = "alexandra.goff@noirlab.edu;ericdrosas@gmail.com"; + $to_list = "alexandra.goff@noirlab.edu,ericdrosas@gmail.com"; break; case "site_visit": $to_list = "ericdrosas@gmail.com";