]> git.agnieray.net Git - galette.git/commitdiff
Fix reminders on postgresql; add timeout on mail
authorJohan Cwiklinski <jcwiklinski@teclib.com>
Mon, 27 Jan 2020 20:44:23 +0000 (21:44 +0100)
committerJohan Cwiklinski <jcwiklinski@teclib.com>
Mon, 27 Jan 2020 20:44:23 +0000 (21:44 +0100)
galette/lib/Galette/Core/GaletteMail.php
galette/lib/Galette/Repository/Reminders.php

index 0472bf1a65675284fc8f52cbe9f4b10b8e60e772..4e796c95733cd01ff5feaad01552b67d1fe23c83 100644 (file)
@@ -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;
+    }
 }
index 20cda1647bc3e33df748c3fbd63ec46a7b26e7f0..56f54df3a11591ecfedbabaf036a06bf74b279d5 100644 (file)
@@ -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);