X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fema.git;a=blobdiff_plain;f=eventos%2Fviews.py;fp=eventos%2Fviews.py;h=61030455e09c99922aa094b7483a6f048ba41516;hp=5427973e0ad3cca604ee05ea363494fbf62cbd84;hb=deadf34b1bdeb533acfe462882439ed2e589dcee;hpb=a8cba117d7b7f80ac0f18a0481cb3eefbbed4852
diff --git a/eventos/views.py b/eventos/views.py
index 5427973..6103045 100644
--- a/eventos/views.py
+++ b/eventos/views.py
@@ -27,6 +27,7 @@ from django.template import RequestContext, Context, loader
from eventos.models import Palestrante, Trabalho, TipoTrabalho, Trilha, Evento, Improve
from eventos.forms import RegisterSpeaker
from django.db.models import Q
+import smtplib
forbidden = \
HttpResponseForbidden('
You are not allowed to do this action.')
@@ -322,6 +323,18 @@ def talk_improve(request, tid):
if cleaned['trabalho'].evento.id != event.id:
return forbidden
+ emails = [i.email for i in speakers]
+ user = cleaned['usuario'].get_full_name()
+ comments = cleaned['comentario']
+ msg = (u"From: emsl@minaslivre.org\r\nTo: %s\r\n"
+ u"Subject: Comentário em seu Trabalho EMSL 2008\r\n"
+ u"Content-Type: text/plain; charset=utf-8\r\n"
+ u"\r\n %s comentou seu trabalho.\r\n%s\r\r\n"
+ % (", ".join(emails), user, comments))
+ smtp = smtplib.SMTP("localhost")
+ smtp.sendmail("emsl@minaslivre.org", emails, str(msg.encode("utf8")))
+ smtp.quit()
+
instance = form.save()
return HttpResponseRedirect('/improve/%d/' % talk.id)