From: Johan Cwiklinski Date: Mon, 27 Jan 2020 20:44:23 +0000 (+0100) Subject: Fix reminders on postgresql; add timeout on mail X-Git-Tag: 0.9.3.1~1^2~3 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=e25da5bac270235c74e59176df82b47c51024a6f;p=galette.git Fix reminders on postgresql; add timeout on mail --- diff --git a/galette/lib/Galette/Core/GaletteMail.php b/galette/lib/Galette/Core/GaletteMail.php index 0472bf1a6..4e796c957 100644 --- a/galette/lib/Galette/Core/GaletteMail.php +++ b/galette/lib/Galette/Core/GaletteMail.php @@ -74,6 +74,7 @@ class GaletteMail private $message; private $html; private $word_wrap = 70; + private $timeout = 300; private $errors = array(); private $recipients = array(); @@ -107,6 +108,7 @@ class GaletteMail global $i18n; $this->mail = new PHPMailer(); + $this->mail->Timeout = $this->timeout; switch ($this->preferences->pref_mail_method) { case self::METHOD_SMTP: @@ -554,4 +556,17 @@ class GaletteMail $this->sender_address = $address; return $this; } + + /** + * Set timeout on SMTP connexion + * + * @param integer $timeout SMTP timeout + * + * @return GaletteMail + */ + public function setTimeout($timeout) + { + $this->timeout = $timeout; + return $this; + } } diff --git a/galette/lib/Galette/Repository/Reminders.php b/galette/lib/Galette/Repository/Reminders.php index 20cda1647..56f54df3a 100644 --- a/galette/lib/Galette/Repository/Reminders.php +++ b/galette/lib/Galette/Repository/Reminders.php @@ -126,7 +126,7 @@ class Reminders ); } - $select->group('a.id_adh')->group('r.reminder_type'); + $select->group('a.id_adh')->group('r.reminder_type')->group('p.email_adh'); $results = $zdb->execute($select);