diff --git a/server_files/services/mail.php b/server_files/services/mail.php index 63910ec..b476fb4 100644 --- a/server_files/services/mail.php +++ b/server_files/services/mail.php @@ -44,9 +44,12 @@ class Mailer { /** @var User $admin */ foreach (User::getAdmins() as $admin) { + if (!$admin->doReceiveAnimathMails()) + continue; + $c = preg_replace("#{FIRST_NAME}#", $admin->getFirstName(), $content); $c = preg_replace("#{SURNAME}#", $admin->getSurname(), $c); - // self::sendMail($admin->getEmail(), $subject, $c, $from); + self::sendMail($admin->getEmail(), $subject, $c, $from); } } diff --git a/server_files/views/mon_compte.php b/server_files/views/mon_compte.php index 73dce08..27c29d7 100644 --- a/server_files/views/mon_compte.php +++ b/server_files/views/mon_compte.php @@ -51,12 +51,13 @@ if (!$has_error && (isset($my_account) || isset($new_password))) { - getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?> - - + getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT + ? "J'accepte d'être recontacté par l'association Animath au sujet d'autres activités (facultatif) :" + : "Recevoir les notifications par mail :" ?> + + doReceiveAnimathMails() ? "checked" : "" ?> /> - getRole() == Role::PARTICIPANT) { ?>