示例#1
0
def _new_paper_email(sender, **kw):
    """
    Invia una mail agli organizzatori con i dettagli sul paper presentato.
    """
    tlk = kw['talk']
    subject = '[new paper] "%s %s" - %s' % (sender.user.first_name,
                                            sender.user.last_name, tlk.title)
    body = '''
Title: %(title)s
Duration: %(duration)s (includes Q&A)
Q&A Session: %(qa_duration)s
Language: %(language)s
Type: %(type)s

Abstract: %(abstract)s

Tags: %(tags)s
''' % {
        'title': tlk.title,
        'duration': tlk.duration,
        'qa_duration': tlk.qa_duration,
        'language': tlk.language,
        'abstract': getattr(tlk.getAbstract(), 'body', ''),
        'type': tlk.get_type_display(),
        'tags': [x.name for x in tlk.tags.all()],
    }
    from conference.utils import send_email
    send_email(
        subject=subject,
        message=body,
    )
示例#2
0
def _new_paper_email(sender, **kw):
    """
    Send an email to the organizers with details on the paper presented.
    """
    recipients = settings.TALK_SUBMISSION_NOTIFICATION_EMAIL
    if not recipients:
        # Nothing to do
        return
    tlk = kw['talk']
    subject = '[new paper] "%s %s" - %s' % (sender.user.first_name, sender.user.last_name, tlk.title)
    body = '''
Title: %(title)s
Duration: %(duration)s (includes Q&A)
Language: %(language)s
Type: %(type)s

Abstract: %(abstract)s

Tags: %(tags)s
''' % {
    'title': tlk.title,
    'duration': tlk.duration,
    'language': tlk.language,
    'abstract': getattr(tlk.getAbstract(), 'body', ''),
    'type': tlk.get_type_display(),
    'tags': [ x.name for x in tlk.tags.all() ],
    }
    from conference.utils import send_email
    send_email(
        recipient_list=recipients,
        subject=subject,
        message=body,
    )
示例#3
0
def _new_paper_email(sender, **kw):
    """
    Invia una mail agli organizzatori con i dettagli sul paper presentato.
    """
    tlk = kw['talk']
    subject = '[new paper][%s] "%s %s" - %s' % (tlk.conference, sender.user.first_name, sender.user.last_name, tlk.title)
    body = '''
Title: %(title)s
Duration: %(duration)s (includes Q&A)
Q&A Session: %(qa_duration)s
Language: %(language)s
Type: %(type)s

Abstract: %(abstract)s

%(tags)s
''' % {
    'title': tlk.title,
    'duration': tlk.duration,
    'qa_duration': tlk.qa_duration,
    'language': tlk.language,
    'abstract': getattr(tlk.getAbstract(), 'body', ''),
    'type': tlk.get_type_display(),
    'tags': "Tags: %s" % ", ".join([ x.name for x in tlk.tags.all() ]) if tlk.tags.count() else "",
    }
    from conference.utils import send_email
    send_email(
        subject=subject,
        message=body,
    )
示例#4
0
文件: views.py 项目: pyconuy/site
def proposal_add(request):

    try:
        speaker = Speaker.objects.get(user=request.user)
    except Speaker.DoesNotExist:
        if request.user.first_name or request.user.last_name:
            name = u'{0} {1}'.format(request.user.first_name, request.user.last_name)
        else:
            name = request.user.username
        speaker = Speaker(user=request.user,
            name = name,
            invite_email = request.user.email,
            invite_token = '')

    if request.method == 'POST':
        form = ProposalForm(request.POST)

        if form.is_valid():

            # Save speaker
            speaker.biography = form.cleaned_data['biography']
            speaker.annotation = speaker.annotation or ''
            speaker.save()

            # Save proposal
            proposal = Proposal.objects.create(
                title=form.cleaned_data['title'],
                description=form.cleaned_data['description'],
                kind=form.cleaned_data['kind'],
                category=PresentationCategory.objects.get(slug='general'),
                abstract=form.cleaned_data['abstract'],
                audience_level=form.cleaned_data['audience_level'],
                additional_notes=form.cleaned_data['additional_notes'],
                duration=form.cleaned_data['duration'],
                speaker=speaker,
                submitted=datetime.datetime.now(),
                cancelled=False)

            # Send to [email protected]
            send_email(settings.PROPOSALS_SEND_TO, 'proposal', context={
                'proposal': proposal,
            })

            return HttpResponseRedirect('/proposal-sent')
    else:
        form = ProposalForm(initial={'biography': speaker.biography.raw})

    return render_to_response('proposal_add.html', {
        'form': form,
        }, context_instance=RequestContext(request))
示例#5
0
文件: models.py 项目: pyconuy/site
 def send_coordinator_emails(self):
     for user in User.objects.filter(groups__name=SPONSOR_COORDINATORS):
         send_email(
             [user.email], "sponsor_signup",
             context = {"sponsor": self}
         )