From b5dd1711b6e6890d3acf93b979f4ed63fe65183e Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Tue, 16 Nov 2004 20:43:06 +0000 Subject: [PATCH] use the new HermesMailer everywhere ! --- include/identification.inc.php | 16 ++++++++-------- include/tpl.mailer.inc.php | 15 +++++++++------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/include/identification.inc.php b/include/identification.inc.php index 9316ce9..f7ef789 100644 --- a/include/identification.inc.php +++ b/include/identification.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: identification.inc.php,v 1.15 2004-11-15 21:04:29 x2002marichez Exp $ + $Id: identification.inc.php,v 1.16 2004-11-16 20:43:06 x2000habouzit Exp $ ***************************************************************************/ require_once('xorg.misc.inc.php'); @@ -192,12 +192,12 @@ if ( $homonyme ) { if ( $h_type != 'homonyme' and empty($expire) ) { $globals->db->query("UPDATE aliases SET expire=ADDDATE(NOW(),INTERVAL 1 MONTH) WHERE alias='$mailorg'"); $globals->db->query("REPLACE INTO homonymes (homonyme_id,user_id) VALUES ($h_id,$h_id)"); - require_once('diogenes.mailer.inc.php'); - $mailer = new DiogenesMailer('Support Polytechnique.org ', - "$mailorg@polytechnique.org", - "perte de ton alias $mailorg dans un mois !", - false, - 'Support Polytechnique.org '); + require_once('diogenes.hermes.inc.php'); + $mailer = new HermesMailer(); + $mailer->setFrom('Support Polytechnique.org '); + $mailer->addTo("$mailorg@polytechnique.org"); + $mailer->setSubject("perte de ton alias $mailorg dans un mois !"); + $mailer->addCc('Support Polytechnique.org '); $msg = "Un homonyme s'est inscrit, nous ne pouvons donc garder ton alias '$mailorg'.\n\n". "Tu gardes tout de même l'usage de cet alias pour 1 mois encore à compter de ce jour.\n\n". @@ -208,7 +208,7 @@ if ( $homonyme ) { "-- \n". "Polytechnique.org\n". "\"Le portail des élèves & anciens élèves de l'X\""; - $mailer->SetBody(wordwrap($msg,72)); + $mailer->SetTxtBody(wordwrap($msg,72)); $mailer->send(); } unset($mailorg); diff --git a/include/tpl.mailer.inc.php b/include/tpl.mailer.inc.php index 19dc6f4..83168f1 100644 --- a/include/tpl.mailer.inc.php +++ b/include/tpl.mailer.inc.php @@ -18,10 +18,10 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: tpl.mailer.inc.php,v 1.3 2004-08-31 11:16:48 x2000habouzit Exp $ + $Id: tpl.mailer.inc.php,v 1.4 2004-11-16 20:45:09 x2000habouzit Exp $ ***************************************************************************/ -require_once("diogenes.mailer.inc.php"); +require_once("diogenes.hermes.inc.php"); require_once("Smarty.class.php"); /** Classe de mail avec corps en templates. @@ -68,10 +68,13 @@ class TplMailer extends Smarty { // do not try to optimize, in the templates, some function can modify our object, then we // have to fetch in the first time, and only then send the mail. $body = $this->fetch($this->mail_dir."/".$this->_tpl); - $mailer = new DiogenesMailer($this->_from, implode(',',$this->_to), - $this->_subject, false, - implode(',',$this->_cc), implode(',',$this->_bcc)); - $mailer->setBody($body); + $mailer = new HermesMailer() + $mailer->setFrom($this->_from); + $mailer->addTo(implode(',',$this->_to)); + $mailer->setSubject($this->_subject); + if (!empty($this->_cc)) $mailer->addCc(implode(',',$this->_cc)); + if (!empty($this->_cc)) $mailer->addBcc(implode(',',$this->_bcc)); + $mailer->setTxtBody($body); $mailer->send(); } } -- 2.1.4