1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-01-07 13:02:21 +00:00

Notifications par mail admin

This commit is contained in:
Yohann 2019-10-21 23:22:21 +02:00
parent 7e4a08cf48
commit b8d4c24d0c
2 changed files with 10 additions and 6 deletions

View File

@ -44,9 +44,12 @@ class Mailer
{ {
/** @var User $admin */ /** @var User $admin */
foreach (User::getAdmins() as $admin) { foreach (User::getAdmins() as $admin) {
if (!$admin->doReceiveAnimathMails())
continue;
$c = preg_replace("#{FIRST_NAME}#", $admin->getFirstName(), $content); $c = preg_replace("#{FIRST_NAME}#", $admin->getFirstName(), $content);
$c = preg_replace("#{SURNAME}#", $admin->getSurname(), $c); $c = preg_replace("#{SURNAME}#", $admin->getSurname(), $c);
// self::sendMail($admin->getEmail(), $subject, $c, $from); self::sendMail($admin->getEmail(), $subject, $c, $from);
} }
} }

View File

@ -51,12 +51,13 @@ if (!$has_error && (isset($my_account) || isset($new_password))) {
</div> </div>
</div> </div>
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?> <label for="receive_animath_mails">
<label for="receive_animath_mails">J'accepte d'être recontacté par l'association <em>Animath</em> au sujet <?= $user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT
d'autres activités (<em>facultatif</em>) :</label> ? "J'accepte d'être recontacté par l'association <em>Animath</em> au sujet d'autres activités (<em>facultatif</em>) :"
<input type="checkbox" id="receive_animath_mails" name="receive_animath_mails" : "Recevoir les notifications par mail :" ?>
</label>
<input type="checkbox" id="receive_animath_mails" name="receive_animath_mails"
<?= $user->doReceiveAnimathMails() ? "checked" : "" ?> /> <?= $user->doReceiveAnimathMails() ? "checked" : "" ?> />
<?php } ?>
<?php if ($user->getRole() == Role::PARTICIPANT) { ?> <?php if ($user->getRole() == Role::PARTICIPANT) { ?>
<div class="form-row"> <div class="form-row">