Пример #1
0
def send_event_update_mail(event, moderators_email):

    current_site = Site.objects.get_current()
    extra_context = {'event': event, 'site_url': '{}://{}'.format(settings.SITE_SCHEME, current_site.domain)}

    # Send mail to moderators
    send_email('FOSSEvents | ' + event.name[:15] + ' updated!',
               'email/event_update_moderators_email.txt', moderators_email,
               extra_context, 'email/event_update_moderators_email.html')

    # Send mail to creator
    send_email('FOSSEvents | ' + event.name[:15] + ' updated!',
               'email/event_update_creator_email.txt', [event.owner_email],
               extra_context, 'email/event_update_creator_email.html')
Пример #2
0
def send_event_update_mail(event, users_emails):

    current_site = Site.objects.get_current()
    extra_context = {'event': event, 'review_url': get_event_review_url(event),
                     'site_url': '{}://{}'.format(settings.SITE_SCHEME, current_site.domain)}

    # Send mail to moderators
    send_email('FOSSEvents | ' + event.name[:15] + ' updated!',
               'email/event_update_moderators_email.txt', users_emails,
               extra_context, 'email/event_update_moderators_email.html')

    # Send mail to creator
    send_email('FOSSEvents | ' + event.name[:15] + ' updated!',
               'email/event_update_creator_email.txt', [event.owner_email],
               extra_context, 'email/event_update_creator_email.html')
Пример #3
0
def send_event_review_mail(review, moderator):
    users_emails = User.objects.email_users().values_list(flat=True)

    current_site = Site.objects.get_current()
    extra_context = {'event': review.event, 'moderator': moderator, 'notes': review.comment,
                     'site_url': '{}://{}'.format(settings.SITE_SCHEME, current_site.domain)}

    # Send mail to moderators
    send_email('FOSSEvents | ' + review.event.name[:15] + ' reviewed!',
               'email/event_review_moderators_email.txt', users_emails,
               extra_context, 'email/event_review_moderators_email.html')

    # Send mail to creator
    send_email('FOSSEvents | ' + review.event.name[:15] + ' reviewed!',
               'email/event_review_creator_email.txt', [review.event.owner_email],
               extra_context, 'email/event_review_creator_email.html')