Refactor email templates into separate directories
This commit is contained in:
parent
da3626ec66
commit
787e825f2e
28 changed files with 22 additions and 22 deletions
|
@ -30,8 +30,8 @@ def email_host_new_event(event):
|
|||
'site': Site.objects.get(id=1),
|
||||
}
|
||||
email_subject = '[GetTogether] New event: %s' % event.name
|
||||
email_body_text = render_to_string('get_together/emails/event_from_series.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/event_from_series.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/events/event_from_series.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/events/event_from_series.html', context)
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
for attendee in Attendee.objects.filter(event=event, role=Attendee.HOST, user__user__account__is_email_confirmed=True):
|
||||
|
|
|
@ -46,8 +46,8 @@ def send_new_attendees(event, new_attendees):
|
|||
}
|
||||
|
||||
email_subject = '[GetTogether] New event attendees'
|
||||
email_body_text = render_to_string('get_together/emails/new_event_attendees.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/new_event_attendees.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/events/new_event_attendees.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/events/new_event_attendees.html', context)
|
||||
email_recipients = [host.email for host in hosts]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ def send_new_members(team, new_members):
|
|||
}
|
||||
|
||||
email_subject = '[GetTogether] New team members'
|
||||
email_body_text = render_to_string('get_together/emails/new_team_members.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/new_team_members.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/teams/new_team_members.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/teams/new_team_members.html', context)
|
||||
email_recipients = [admin.email for admin in admins]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ class Command(BaseCommand):
|
|||
'confirmation_url': confirmation_url,
|
||||
}
|
||||
email_subject = '[GetTogether] Email confirmation reminder'
|
||||
email_body_text = render_to_string('get_together/emails/confirm_email.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/confirm_email.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/users/confirm_email.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/users/confirm_email.html', context)
|
||||
email_recipients = [account.user.email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
success = send_mail(
|
||||
|
|
|
@ -42,8 +42,8 @@ class Command(BaseCommand):
|
|||
}
|
||||
|
||||
email_subject = '[GetTogether] Upcoming event reminder'
|
||||
email_body_text = render_to_string('get_together/emails/reminder.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/reminder.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/events/reminder.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/events/reminder.html', context)
|
||||
email_recipients = [attendee.user.user.email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
|
|
@ -295,8 +295,8 @@ def invite_attendee(email, event, sender):
|
|||
email = recipient.email
|
||||
|
||||
email_subject = '[GetTogether] Invite to attend %s' % event.name
|
||||
email_body_text = render_to_string('get_together/emails/attendee_invite.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/attendee_invite.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/events/attendee_invite.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/events/attendee_invite.html', context)
|
||||
email_recipients = [email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
@ -326,8 +326,8 @@ def contact_attendee(attendee, body, sender):
|
|||
'site': Site.objects.get(id=1),
|
||||
}
|
||||
email_subject = '[GetTogether] Message about %s' % attendee.event.name
|
||||
email_body_text = render_to_string('get_together/emails/attendee_contact.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/attendee_contact.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/events/attendee_contact.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/events/attendee_contact.html', context)
|
||||
email_recipients = [attendee.user.user.email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
@ -417,8 +417,8 @@ def send_comment_emails(comment):
|
|||
'site': Site.objects.get(id=1),
|
||||
}
|
||||
email_subject = '[GetTogether] Comment on %s' % comment.event.name
|
||||
email_body_text = render_to_string('get_together/emails/event_comment.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/event_comment.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/events/event_comment.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/events/event_comment.html', context)
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
for attendee in comment.event.attendees.filter(user__account__is_email_confirmed=True):
|
||||
|
|
|
@ -144,8 +144,8 @@ def user_send_confirmation_email(request):
|
|||
'confirmation_url': confirmation_url,
|
||||
}
|
||||
email_subject = '[GetTogether] Confirm email address'
|
||||
email_body_text = render_to_string('get_together/emails/confirm_email.txt', context, request)
|
||||
email_body_html = render_to_string('get_together/emails/confirm_email.html', context, request)
|
||||
email_body_text = render_to_string('get_together/emails/users/confirm_email.txt', context, request)
|
||||
email_body_html = render_to_string('get_together/emails/users/confirm_email.html', context, request)
|
||||
email_recipients = [request.user.email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
success = send_mail(
|
||||
|
|
|
@ -239,8 +239,8 @@ def invite_member(email, team, sender):
|
|||
'site': Site.objects.get(id=1),
|
||||
}
|
||||
email_subject = '[GetTogether] Invite to join %s' % team
|
||||
email_body_text = render_to_string('get_together/emails/member_invite.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/member_invite.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/teams/member_invite.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/teams/member_invite.html', context)
|
||||
email_recipients = [email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
@ -271,8 +271,8 @@ def contact_member(member, body, sender):
|
|||
'site': Site.objects.get(id=1),
|
||||
}
|
||||
email_subject = '[GetTogether] Message from %s' % member.team
|
||||
email_body_text = render_to_string('get_together/emails/member_contact.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/member_contact.html', context)
|
||||
email_body_text = render_to_string('get_together/emails/teams/member_contact.txt', context)
|
||||
email_body_html = render_to_string('get_together/emails/teams/member_contact.html', context)
|
||||
email_recipients = [member.user.user.email]
|
||||
email_from = getattr(settings, 'DEFAULT_FROM_EMAIL', 'noreply@gettogether.community')
|
||||
|
||||
|
|
Loading…
Reference in a new issue