emails with site url
This commit is contained in:
@@ -758,6 +758,7 @@ def handle_sendemail_raceregistration(
|
||||
d = {
|
||||
'username':username,
|
||||
'registeredname':registeredname,
|
||||
'siteurl':siteurl,
|
||||
'racename':racename,
|
||||
'raceid':raceid,
|
||||
}
|
||||
@@ -786,6 +787,7 @@ def handle_sendemail_racesubmission(
|
||||
|
||||
d = {
|
||||
'username':username,
|
||||
'siteurl':siteurl,
|
||||
'registeredname':registeredname,
|
||||
'racename':racename,
|
||||
'raceid':raceid,
|
||||
@@ -816,6 +818,7 @@ def handle_send_disqualification_email(
|
||||
d = {
|
||||
'username':username,
|
||||
'reason':reason,
|
||||
'siteurl':siteurl,
|
||||
'message': strip_tags(message),
|
||||
'racename':racename,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
<p>
|
||||
Unfortunately, the result that you have submitted
|
||||
for the virtual race {{ racename }}
|
||||
for the virtual race
|
||||
{{ racename }}
|
||||
has been rejected by the race organizer.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
|
||||
<p>
|
||||
You can check race participants and results on the race page on Rowsandall:
|
||||
<a href="https://rowsandall.com/rowers/virtualevent/{{ raceid }}">{{ racename }}</a>
|
||||
<a href="{{ siteurl }}/rowers/virtualevent/{{ raceid }}">{{ racename }}</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You are receiving this email because you are on the start list for this race.
|
||||
If you do not wish to receive these notifications, you can switch them off
|
||||
throught the link above.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
|
||||
<p>
|
||||
Check out the results on the race page!
|
||||
<a href="https://rowsandall.com/rowers/virtualevent/{{ raceid }}">{{ racename }}</a>
|
||||
<a href="{{ siteurl }}/rowers/virtualevent/{{ raceid }}">{{ racename }}</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You are receiving this email because you are on the start list for this race.
|
||||
If you do not wish to receive these notifications, you can switch them off
|
||||
throught the link above.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -144,6 +144,10 @@ urlpatterns = [
|
||||
url(r'^virtualevents$',views.virtualevents_view),
|
||||
url(r'^virtualevent/create$',views.virtualevent_create_view),
|
||||
url(r'^virtualevent/createindoor$',views.indoorvirtualevent_create_view),
|
||||
url(r'^raceregistration/togglenotification/(?P<id>\d+)/$',
|
||||
views.virtualevent_toggle_email_view),
|
||||
url(r'^indoorraceregistration/togglenotification/(?P<id>\d+)/$',
|
||||
views.indoorvirtualevent_toggle_email_view),
|
||||
url(r'^virtualevent/(?P<id>\d+)$',views.virtualevent_view),
|
||||
url(r'^virtualevent/(?P<id>\d+)/edit$',views.virtualevent_edit_view),
|
||||
url(r'^virtualevent/(?P<id>\d+)/editindoor$',views.indoorvirtualevent_edit_view),
|
||||
|
||||
@@ -16695,6 +16695,48 @@ def virtualevent_register_view(request,id=0):
|
||||
|
||||
})
|
||||
|
||||
@login_required()
|
||||
def virtualevent_toggle_email_view(request,id=0):
|
||||
r = getrower(request.user)
|
||||
race = VirtualRace.objects.get(id=id)
|
||||
records = VirtualRaceResult.objects.filter(userid=r.id,race=race)
|
||||
|
||||
if True in [record.emailnotifications for record in records]:
|
||||
newsetting = False
|
||||
else:
|
||||
newsetting = True
|
||||
|
||||
for record in records:
|
||||
record.emailnotifications = newsetting
|
||||
record.save()
|
||||
|
||||
url = reverse(virtualevent_view,
|
||||
kwargs={'id':record.race.id})
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
@login_required()
|
||||
def indoorvirtualevent_toggle_email_view(request,id=0):
|
||||
r = getrower(request.user)
|
||||
race = VirtualRace.objects.get(id=id)
|
||||
|
||||
records = IndoorVirtualRaceResult.objects.filter(userid=r.id,
|
||||
race=race)
|
||||
|
||||
if True in [record.emailnotifications for record in records]:
|
||||
newsetting = False
|
||||
else:
|
||||
newsetting = True
|
||||
|
||||
for record in records:
|
||||
record.emailnotifications = newsetting
|
||||
record.save()
|
||||
|
||||
url = reverse(virtualevent_view,
|
||||
kwargs={'id':record.race.id})
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
@login_required()
|
||||
def indoorvirtualevent_register_view(request,id=0):
|
||||
r = getrower(request.user)
|
||||
|
||||
Reference in New Issue
Block a user