Adds the text of the article in the mail when refused (Closes #991).
[platal.git] / include / validations.inc.php
index 4ae9086..aaa6bf5 100644 (file)
@@ -236,8 +236,11 @@ abstract class Validate
 
         $body = ($this->user->isFemale() ? "Chère camarade,\n\n" : "Cher camarade,\n\n")
               . $this->_mail_body($isok)
-              . (Env::has('comm') ? "\n\n".Env::v('comm') : '')
-              . "\n\nCordialement,\n\n-- \nL'équipe de Polytechnique.org\n";
+              . (Env::has('comm') ? "\n\n" . Env::v('comm') : '')
+              . "\n\nCordialement,\n-- \nL'équipe de Polytechnique.org\n";
+        if (!is_null($this->_mail_ps($isok))) {
+            $body .= $this->_mail_ps($isok);
+        }
 
         $mailer->setTxtBody(wordwrap($body));
         $mailer->send();
@@ -333,6 +336,14 @@ abstract class Validate
     abstract protected function _mail_subj();
 
     // }}}
+    // {{{ function _mail_ps
+
+    protected function _mail_ps($isok)
+    {
+        return null;
+    }
+
+    // }}}
     // {{{ function commit()
 
     /** fonction à utiliser pour insérer les données dans x4dat