Skip to content

Commit

Permalink
Changed hardcoded emails to env vars for contact f
Browse files Browse the repository at this point in the history
Changed hardcoded emails to env vars for contact form
  • Loading branch information
ericdrosas87 committed Oct 7, 2024
1 parent a7f7564 commit 78d5d9d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions api/config/contact-form.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<?php

use Craft;
use craft\helpers\App;

$request = Craft::$app->request;

// 'toEmail' => '[email protected]', // 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 = "[email protected],[email protected]";
$to_list = App::env('CONTACT_FORM_TO_ADDRESSES_FOR_FEEDBACK');
break;
case "general":
$to_list = "[email protected],[email protected]";
$to_list = App::env('CONTACT_FORM_TO_ADDRESSES_FOR_GENERAL');
break;
case "education":
$to_list = "[email protected],[email protected]";
$to_list = App::env('CONTACT_FORM_TO_ADDRESSES_FOR_EDUCATION');
break;
case "media":
$to_list = "[email protected],[email protected]";
$to_list = App::env('CONTACT_FORM_TO_ADDRESSES_FOR_MEDIA');
break;
case "site_visit":
$to_list = "[email protected]";
$to_list = App::env('CONTACT_FORM_TO_ADDRESSES_FOR_VISITS');
break;
default:
$to_list = "[email protected]";
break;
}

Expand Down

0 comments on commit 78d5d9d

Please sign in to comment.