X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=reminder.py;h=7b7c07fe65de7cb2e3e262c4d479083f15e72176;hb=HEAD;hp=ff75f99c03ac27dd916daf83c93cc047897b7478;hpb=473c73474dbf1dc5b789a847e924599f313c6fcd;p=cavote.git diff --git a/reminder.py b/reminder.py index ff75f99..7b7c07f 100644 --- a/reminder.py +++ b/reminder.py @@ -36,7 +36,7 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_ print userchoice if userchoice is None: #user didn't vote yet - link = "http://vote.ffdn.org/vote/%d" % vote[0] + link = VOTE_URL % vote[0] BODY = string.join(( "From: %s" % EMAIL, "To: %s" % user[1], @@ -45,7 +45,7 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_ "Content-type: text/plain; charset=utf-8", "X-Mailer: %s" % VERSION, "", - "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on"), vote[2].encode('utf-8'), vote[3].encode('utf-8')), + "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on"), vote[2], vote[3]), gettext(u"You still didn't take part to it !"), "", gettext(u"This link will bring you to the form where you will be able to participate :"), @@ -56,10 +56,11 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_ server = smtplib.SMTP(SMTP_SERVER) print EMAIL print user[1] - print BODY + print BODY.encode('utf-8') server.sendmail(EMAIL, user[1], BODY.encode('utf-8')) server.quit() else: + link = VOTE_URL % vote[0] BODY = string.join(( "From: %s" % EMAIL, "To: %s" % user[1], @@ -68,7 +69,7 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_ "Content-type: text/plain; charset=utf-8", "X-Mailer: %s" % VERSION, "", - "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on "), vote[2].encode('utf-8'), vote[3].encode('utf-8')), + "%s %s : %s" % (gettext(u"A vote concerns you and is going to terminate on "), vote[2], vote[3]), gettext(u"You have already voted but you can still modify your choice"), "", gettext(u"This link will bring you to the form where you will be able to participate :"), @@ -79,6 +80,6 @@ for vote in c.execute('select id, id_group, date_end, title from votes where is_ server = smtplib.SMTP(SMTP_SERVER) print EMAIL print user[1] - print BODY + print BODY.encode('utf-8') server.sendmail(EMAIL, user[1], BODY.encode('utf-8')) server.quit()