Overview
Comment: | Don't send an email to duplicate addresses |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | stable |
Files: | files | file ages | folders |
SHA3-256: |
301a9f982a025dd65e3c84992ef8c1c7 |
User & Date: | bohwaz on 2021-11-19 15:36:51 |
Other Links: | manifest | tags |
Context
2021-11-20
| ||
12:03 | Add search form to homepage check-in: 3ee41f06d8 user: bohwaz tags: trunk | |
2021-11-19
| ||
15:36 | Don't send an email to duplicate addresses check-in: 301a9f982a user: bohwaz tags: trunk, stable | |
2021-11-17
| ||
15:14 | Fix: in installs before 1.1.0, if there was more than one accounting chart, it didn't have the correct position for volunteering accounts check-in: 51298bd9c4 user: bohwaz tags: trunk, stable | |
Changes
Modified src/include/lib/Garradin/Membres.php from [f55e10008f] to [146768f005].
︙ | ︙ | |||
330 331 332 333 334 335 336 337 338 339 340 341 342 | $sql = sprintf('SELECT id, numero, %s AS identite FROM membres WHERE %s %s ORDER BY %1$s LIMIT 50;', $identity, $column, $operator); return DB::getInstance()->get($sql, $query); } public function sendMessage(array $recipients, $subject, $message, $send_copy) { $config = Config::getInstance(); foreach ($recipients as $key => $recipient) { // Ignorer les destinataires avec une adresse email vide if (empty($recipient->email)) { | > > < > > > > | > > | > | | < < < < | | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | $sql = sprintf('SELECT id, numero, %s AS identite FROM membres WHERE %s %s ORDER BY %1$s LIMIT 50;', $identity, $column, $operator); return DB::getInstance()->get($sql, $query); } public function sendMessage(array $recipients, $subject, $message, $send_copy) { $config = Config::getInstance(); $emails = []; foreach ($recipients as $key => $recipient) { // Ignorer les destinataires avec une adresse email vide if (empty($recipient->email)) { continue; } if (!isset($recipient->email, $recipient->id)) { throw new UserException('Il manque l\'identifiant ou l\'email dans le résultat'); } // Refuser d'envoyer un mail à une adresse invalide, sans vérifier le MX // sinon ça serait trop lent if (!SMTP::checkEmailIsValid($recipient->email, false)) { throw new UserException(sprintf('Adresse email invalide : "%s". Aucun message n\'a été envoyé.', $recipient->email)); } // This is to avoid having duplicate emails $emails[$recipient->email] = $recipient->id; } if (!count($emails)) { throw new UserException('Aucun destinataire de la liste ne possède d\'adresse email.'); } foreach ($emails as $email => $id) { Utils::sendEmail(Utils::EMAIL_CONTEXT_BULK, $email, $subject, $message, $id); } if ($send_copy) { Utils::sendEmail(Utils::EMAIL_CONTEXT_BULK, $config->get('email_asso'), $subject, $message); } |
︙ | ︙ |