From 2758452840626b9cf869ccc3f6bf4aec1ccf39d4 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Thu, 5 May 2022 10:17:02 +0200 Subject: [PATCH] =?UTF-8?q?scission=20des=20adresses=20de=20destination=20?= =?UTF-8?q?pour=20le=20mail=20contact,=20mise=20en=20param=C3=A8tre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env-example | 5 ++++- wp-config.php | 7 ++++--- wp-content/themes/pole-sbv/contact_template.php | 7 ++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.env-example b/.env-example index 390d3790..48692652 100644 --- a/.env-example +++ b/.env-example @@ -24,4 +24,7 @@ RECAPTCHA_SITE= RECAPTCHA_KEY= #CONTACT RECIPIENTS -CONTACT_MAIL="loic.harnieh@pole-sbv.fr, anne-lise.clavel@pole-sbv.fr" \ No newline at end of file +CONTACT_MAIL_RECRUTEMENT="pierre.baudhuin@pole-sbv.fr" +CONTACT_MAIL_COMMERCIAL="marketing.sbv@pole-sbv.fr,anne-lise.clavel@pole-sbv.fr,julie.perrot@pole-sbv.fr" +CONTACT_MAIL_PRESSE="marketing.sbv@pole-sbv.fr,anne-lise.clavel@pole-sbv.fr,julie.perrot@pole-sbv.fr" +CONTACT_MAIL_AUTRE="marketing.sbv@pole-sbv.fr,anne-lise.clavel@pole-sbv.fr,julie.perrot@pole-sbv.fr" \ No newline at end of file diff --git a/wp-config.php b/wp-config.php index 16ebf3d3..95082a21 100755 --- a/wp-config.php +++ b/wp-config.php @@ -127,9 +127,10 @@ define('SMTP_SECURE', $_ENV['SMTP_SECURE']); define('SENDER_MAIL', 'noreply@pole-sbv.fr'); define('SENDERNAME_MAIL', 'SBV'); define('FROM_MAIL', 'noreply@pole-sbv.fr'); -define("CONTACT_MAIL", $_ENV['CONTACT_MAIL']); -//define('CONTACT_RECIPIENT', $_ENV['CONTACT_RECIPIENT']); -//define('MAIL_PASSERELLE', $_ENV['MAIL_PASSERELLE']); +define("CONTACT_MAIL_RECRUTEMENT", $_ENV['CONTACT_MAIL_RECRUTEMENT']); +define("CONTACT_MAIL_COMMERCIAL", $_ENV['CONTACT_MAIL_COMMERCIAL']); +define("CONTACT_MAIL_PRESSE", $_ENV['CONTACT_MAIL_PRESSE']); +define("CONTACT_MAIL_AUTRE", $_ENV['CONTACT_MAIL_AUTRE']); /** * For developers: WordPress debugging mode. diff --git a/wp-content/themes/pole-sbv/contact_template.php b/wp-content/themes/pole-sbv/contact_template.php index 0ba46a81..db1fd8eb 100644 --- a/wp-content/themes/pole-sbv/contact_template.php +++ b/wp-content/themes/pole-sbv/contact_template.php @@ -72,18 +72,23 @@ if('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST[' switch ($type) { case 'recrutement': $tt = "Recrutement"; + $dest = CONTACT_MAIL_RECRUTEMENT; break; case 'besoin-commercial': $tt = "Besoin Commercial"; + $dest = CONTACT_MAIL_COMMERCIAL; break; case 'relation-presse': $tt = "Relation Presse"; + $dest = CONTACT_MAIL_PRESSE; break; case 'autre-demande': $tt = "Autre Demande"; + $dest = CONTACT_MAIL_AUTRE; break; default: $tt = ""; + $dest = CONTACT_MAIL_AUTRE; break; } //------ Envoi Mail aux contacts Passerelle @@ -102,7 +107,7 @@ if('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST[' $bodyMail .= "Message :
".$message."
"; $bodyMail .= ""; $subject = "Nouveau message du site SBV"; - $envoiDone = wp_mail(explode(",",CONTACT_MAIL), $subject, $bodyMail, "", $pj); + $envoiDone = wp_mail(explode(",",$dest), $subject, $bodyMail, "", $pj); $envoiDone = true; }