16
16
from django .db import models , transaction
17
17
from django .db .models import Count , Manager , Q , QuerySet
18
18
from django .http .request import HttpRequest
19
+ from django .urls import reverse
19
20
from django .utils import formats , timezone
20
21
from sentry_sdk import add_breadcrumb , capture_exception
21
22
from simple_history .models import HistoricalRecords
@@ -1140,11 +1141,16 @@ def set_sticky_students(self, users: "Sequence[AbstractBaseUser]") -> None:
1140
1141
1141
1142
self .sticky_students .set (users )
1142
1143
1144
+ base_url = reverse ("eighth_signup" , args = [self .block .id ])
1143
1145
if new_stickied_students :
1144
1146
email_send_task .delay (
1145
1147
"eighth/emails/students_stickied.txt" ,
1146
1148
"eighth/emails/students_stickied.html" ,
1147
- data = {"activity" : self },
1149
+ data = {
1150
+ "activity" : self .activity ,
1151
+ "block" : self .block ,
1152
+ "base_url" : base_url ,
1153
+ },
1148
1154
subject = "You have been stickied into an activity" ,
1149
1155
emails = new_stickied_students ,
1150
1156
bcc = True ,
@@ -1153,7 +1159,11 @@ def set_sticky_students(self, users: "Sequence[AbstractBaseUser]") -> None:
1153
1159
email_send_task .delay (
1154
1160
"eighth/emails/students_unstickied.txt" ,
1155
1161
"eighth/emails/students_unstickied.html" ,
1156
- data = {"activity" : self },
1162
+ data = {
1163
+ "activity" : self .activity ,
1164
+ "block" : self .block ,
1165
+ "base_url" : base_url ,
1166
+ },
1157
1167
subject = "You have been unstickied from an activity" ,
1158
1168
emails = unstickied_students ,
1159
1169
bcc = True ,
0 commit comments