Changeset 99587d8


Ignore:
Timestamp:
Nov 14, 2011, 3:10:55 PM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
ac93a0c
Parents:
712067b
git-author:
Alex Dehnert <adehnert@…> (11/14/11 15:10:55)
git-committer:
Alex Dehnert <adehnert@…> (11/14/11 15:10:55)
Message:

Send mail when startup form is submitted

Location:
asadb
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r7a875d1 r99587d8  
    342342    return welcome_mail, accounts_mail
    343343
    344 def create_group_officers(group, formdata, ):
     344def create_group_officers(group, formdata, save=True, ):
    345345    officer_emails = [ ]
    346346    for officer in ('president', 'treasurer', ):
    347347        username = formdata[officer+'_kerberos']
    348348        if username:
    349             groups.models.OfficeHolder(
     349            if save: groups.models.OfficeHolder(
    350350                person=username,
    351351                role=groups.models.OfficerRole.objects.get(slug=officer),
     
    433433
    434434            context = {
    435                 'group':  group,
    436                 'pagename':   'groups',
     435                'group':            group,
     436                'group_startup':    group_startup,
     437                'pagename':         'groups',
    437438            }
     439
     440            email_from_template(
     441                tmpl='groups/create/startup-submitted-email.txt',
     442                context=context,
     443                subject='ASA Startup Application: %s' % (group.name, ),
     444                to=[request.user.email] + create_group_officers(group, form.cleaned_data, save=False, ),
     445                cc=['asa-groups@mit.edu'],
     446                from_email='asa-groups@mit.edu',
     447            ).send()
     448
    438449            return render_to_response('groups/create/startup_thanks.html', context, context_instance=RequestContext(request), )
    439450        else:
  • asadb/template/groups/create/startup_thanks.html

    r2919697 r99587d8  
    66<h1>Startup form submitted</h1>
    77
    8 <p>You've successfully submitted the startup form for {{group.name}}. We'll get back to you with further information soon.</p>
     8<p>You've successfully submitted the startup form for {{group.name}}. Please verify that you received a confirmation email. We'll get back to you with further information soon.</p>
    99
    1010{% endblock content %}
Note: See TracChangeset for help on using the changeset viewer.