feaa0c1f68386815fdc9158ee6ef841a6d546a89
3 /***************************************************************************
4 * Copyright (C) 2003-2006 Polytechnique.org *
5 * http://opensource.polytechnique.org/ *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
21 ***************************************************************************/
23 require_once('./connect.db.inc.php');
24 require_once("../../include/notifs.inc.php");
25 require_once("diogenes/diogenes.hermes.inc.php");
27 $all = new AllNotifs();
29 foreach($all->_data
as $u) {
30 $week = date("W - Y");
32 $text = " ".($u['sexe'] ?
'Chère' : 'Cher')." {$u['prenom']},\n\n"
33 . " Voici les évènements survenus dans la semaine écoulée,\n"
34 . "et depuis ta dernière visite sur le site.\n\n"
35 . "Tu trouveras les mêmes informations sur la page :\n"
36 . " {$globals->baseurl}/carnet/panel\n\n"
37 . "------------------------------------------------------------------------\n\n";
42 <title>Notifications de la semaine $week</title>
45 <p>Voici les évènements survenus dans la semaine écoulée, et depuis ta dernière visite sur le site.</p>
46 <p>Tu trouveras les mêmes informations sur <a href='{$globals->baseurl}/carnet/panel'>cette page</a></p>
49 foreach($u['data'] as $cid=>$d) {
50 $text .= " {$all->_cats[$cid][(count($d)==1)?'mail_sg':'mail']} :\n\n";
51 $html .= "<h1 style='font-size: 120%'>{$all->_cats[$cid][(count($d)==1)?'mail_sg':'mail']} :</h1>\n<ul>\n";
53 foreach($d as $promo=>$x) {
54 require_once('../../plugins/modifier.date_format.php');
55 $date = smarty_modifier_date_format($x['date'], '%d %b %Y');
56 $text .= " - (X{$x['promo']}) {$x['prenom']} {$x['nom']} le $date\n";
57 $text .= " {$globals->baseurl}/fiche.php?user={$x['bestalias']}&force_login=1\n\n";
58 $html .= "<li>(X{$x['promo']}) <a href='{$globals->baseurl}/fiche.php?user={$x['bestalias']}&force_login=1'>{$x['prenom']} {$x['nom']}</a> le $date</li>\n";
65 . "L'équipe de Polytechnique.org\n\n"
66 . "------------------------------------------------------------------------\n\n"
67 . "Tu recois ce mail car tu as activé la notification automatique \n"
68 . "par mail des évènements que tu surveilles.\n\n"
69 . "Tu peux changer cette option sur :\n"
70 . " {$globals->baseurl}/carnet/notifs";
73 <p>L'équipe de Polytechnique.org</p>
76 Tu recois ce mail car tu as activé la notification automatique par mail des évènements que tu surveilles.
78 <p>Tu peux changer cette option sur la <a href="{$globals->baseurl}/carnet/notifs">page
79 de configuration des notifications</a>
85 $mailer = new HermesMailer();
86 $mailer->setFrom("Carnet Polytechnicien <support_carnet@polytechnique.org>");
87 $mailer->addTo("\"{$u['prenom']} {$u['nom']}\" <{$u['bestalias']}@polytechnique.org>");
88 $mailer->setSubject("Notifications de la semaine $week");
89 $mailer->setTxtBody($text);
90 if ($u['mail_fmt'] == 'html') { $mailer->setHtmlBody($html); }