[mail] Templating

This commit is contained in:
Valentin Samir 2013-10-01 19:28:35 +02:00
parent 6b0f94a59d
commit 0addbac08e
22 changed files with 112 additions and 86 deletions

View file

@ -15,6 +15,7 @@ import re
import ldap_crans
conn = ldap_crans.CransLdap()
import mail as mail_module
import sys
#: envoyer un mail à chaque adhérent concerné
sendmails = False
@ -69,9 +70,12 @@ for clandestin in bad_boys_e_s:
if not "@" in to:
to += "@crans.org"
mail = config.mails.demenagement.message_demenagement % {"from" : "respbats@crans.org",
mail = mail_module.generate('demenagement', {"from" : "respbats@crans.org",
"chambre" : exchambre,
"jours" : int(ttl/86400) + 1,
"to" : to}
"to" : to,
"lang_info":"English version below"}
).as_string()
if DEBUG:
print mail
mailer = os.popen("/usr/sbin/sendmail -t", "w")