示例#1
0
def send_email_submitted(request, version):
    extension = version.extension

    url = request.build_absolute_uri(reverse('review-version',
                                             kwargs=dict(pk=version.pk)))

    data = dict(url=url)

    recipient_list = list(get_all_reviewers().values_list('email', flat=True))

    message = render_mail(version, 'submitted', data)
    message.to = recipient_list
    message.extra_headers.update({'X-SweetTooth-Purpose': 'NewExtension',
                                  'X-SweetTooth-ExtensionCreator': extension.creator.username})

    message.send()
示例#2
0
def send_email_auto_approved(request, version):
    extension = version.extension

    review_url = request.build_absolute_uri(reverse('review-version',
                                                    kwargs=dict(pk=version.pk)))
    version_url = request.build_absolute_uri(version.get_absolute_url())

    recipient_list = list(get_all_reviewers().values_list('email', flat=True))
    recipient_list.append(extension.creator.email)

    data = dict(version_url=version_url,
                review_url=review_url)

    message = render_mail(version, 'auto_approved', data)
    message.to = recipient_list
    message.extra_headers.update({'X-SweetTooth-Purpose': 'AutoApproved',
                                  'X-SweetTooth-ExtensionCreator': extension.creator.username})
    message.send()