# HG changeset patch # User Anoop Jacob Thomas # Date 1289284362 -19800 # Node ID 3a32df4b31718c379010ca57580f11370b432feb # Parent 30053a24a92a8855105a7460949d5f6de7b4ffad added custom invitation mail page. diff -r 30053a24a92a -r 3a32df4b3171 sdi/events.py --- a/sdi/events.py Fri Sep 03 16:37:03 2010 +0530 +++ b/sdi/events.py Tue Nov 09 12:02:42 2010 +0530 @@ -269,3 +269,74 @@ for emails in to_emails: send_mail(subject, message, "sagedays@fossee.in", emails) + +def mail_cust_invi(to_emails): + """ send the custom invitation email to given email addresses. + """ + + subject = "SciPy 2010 Call for Papers & Participation" + + message = """ +========================================== +SciPy 2010 Call for Papers & Participation +========================================== + +The second SciPy India Conference will be held +from December 13th to 18th, 2010 at IIIT-Hyderabad +. + +At this conference, novel applications and breakthroughs made in the +pursuit of science using Python are presented. Attended by leading +figures from both academia and industry, it is an excellent +opportunity to experience the cutting edge of scientific software +development. + +The conference is followed by two days of tutorials and a code sprint, +during which community experts provide training on several scientific +Python packages. + +We invite you to take part by submitting a talk abstract or register +as a participant on the conference website at: + +http://scipy.in + +Talk/Paper Submission +===================== + +We solicit talks and accompanying papers (either formal academic or +magazine-style articles) that discuss topics regarding scientific +computing using Python, including applications, teaching, development +and research. Papers are included in the peer-reviewed conference +proceedings, published online. + +Please note that submissions primarily aimed at the promotion of a +commercial product or service will not be considered. + +Important Dates +=============== + +Wednesday, Nov. 10: Abstracts Due +Monday, Nov. 15: Schedule announced +Sunday, Dec. 05: Proceedings paper submission due +Monday-Tuesday, Dec. 13-14: Conference +Wednesday-Friday, Dec. 15-17: Tutorials/Sprints +Saturday, Dec. 18: Sprints + +Organizers +========== + +* Jarrod Millman, Neuroscience Institute, UC Berkeley, USA (Conference Co-Chair) +* Prabhu Ramachandran, Department of Aerospace Engineering, IIT +Bombay, India (Conference Co-Chair) +* FOSSEE Team + +-- +Scipy India Team, +FOSSEE, IIT Bombay. + +www.scipy.in +""" + + for emails in to_emails: + send_mail(subject, message, "info@scipy.in", emails) + diff -r 30053a24a92a -r 3a32df4b3171 sdi/site/urls.py --- a/sdi/site/urls.py Fri Sep 03 16:37:03 2010 +0530 +++ b/sdi/site/urls.py Tue Nov 09 12:02:42 2010 +0530 @@ -1,6 +1,6 @@ from django.conf.urls.defaults import * -from sage_days.sdi.views import register, reg_complete, list_stats, homepage, send_invi, admin_login, admin_logout +from sage_days.sdi.views import register, reg_complete, list_stats, homepage, send_invi, admin_login, admin_logout, send_cust_invi from sage_days.sdi.views import send_workshop_confirm, confirm_wsp_participation, send_sagedays_confirm, confirm_sgd_participation from sage_days.sdi.views import send_acco_confirm, confirm_address @@ -9,6 +9,7 @@ (r'^complete/$', reg_complete), (r'^stats/$', list_stats), (r'^send_invi/$', send_invi), + (r'^send_cust_invi/$', send_cust_invi), (r'^login/$', admin_login), (r'^logout/$', admin_logout), (r'^send_wsp_cnf/$', send_workshop_confirm), diff -r 30053a24a92a -r 3a32df4b3171 sdi/views.py --- a/sdi/views.py Fri Sep 03 16:37:03 2010 +0530 +++ b/sdi/views.py Tue Nov 09 12:02:42 2010 +0530 @@ -7,7 +7,7 @@ from sage_days.sdi.models import Registrant, RegistrantInfo, ParticipantInfo from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm, ParticipantInfoForm, SendAccoForm, EditAddressForm -from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_sgd_ptc_confirm, send_cnf_email, send_wsp_ptc_confirm, send_acco_confirm_mail +from sage_days.sdi.events import send_reg_complete_mail, mail_invi, mail_cust_invi, send_sgd_ptc_confirm, send_cnf_email, send_wsp_ptc_confirm, send_acco_confirm_mail from sage_days.settings import APACHE_URL_PREFIX as aup def register(request): @@ -116,6 +116,24 @@ return render_to_response("send_invi.html", {"form":form}) @login_required +def send_cust_invi(request): + """ Take a list of csv email addresses and send mails to them. + """ + + if request.method == "POST": + form = EmailForm(request.POST) + if form.is_valid(): + to_emails = form.cleaned_data['emails'] + mail_cust_invi(to_emails) + return render_to_response("send_cust_invi.html", {"emails":to_emails}) + else: + return render_to_response("send_cust_invi.html", {"form":form}) + else: + form = EmailForm() + return render_to_response("send_cust_invi.html", {"form":form}) + + +@login_required def send_workshop_confirm(request): """ Show a list of all the ppl who requested for a workshop and send a confirmation mail to them if not sent. diff -r 30053a24a92a -r 3a32df4b3171 templates/send_cust_invi.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/send_cust_invi.html Tue Nov 09 12:02:42 2010 +0530 @@ -0,0 +1,15 @@ +{% extends 'base.html' %} +{% block title %} +Send Custom Invitations +{% endblock %} +{% block content %} +{% if form %} +
+{{form.as_p}} + +
+{% else %} +Successfully sent emails to:
+{{ emails|unordered_list}} +{% endif %} +{% endblock %}