Skip to content

Commit 822e757

Browse files
committed
adds waitlist emails
1 parent 6ff0b61 commit 822e757

File tree

16 files changed

+224
-103
lines changed

16 files changed

+224
-103
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {mentor_name},<br>
3-
&emsp;{student_name} has been dropped from your {course_title} section by a coordinator.<br>
4-
Best,<br>
2+
Hi {mentor_name},<br />
3+
&emsp;{student_name} has been dropped from your {course_title} section by a coordinator.<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<p>
2-
Hi {student_name},<br>
3-
&emsp;This is a courtesy notice that you have been dropped from your {course_title} CSM section since you have had at least one unexcused absence during the first two weeks of sections, and did not reach out after we emailed you.<br>
4-
&emsp; Please let us know if you have any questions or concerns by replying to this email.<br>
5-
Best,<br>
2+
Hi {student_name},<br />
3+
&emsp;This is a courtesy notice that you have been dropped from your {course_title} CSM section since you have had at
4+
least one unexcused absence during the first two weeks of sections, and did not reach out after we emailed you.<br />
5+
&emsp; Please let us know if you have any questions or concerns by replying to this email.<br />
6+
Best,<br />
67
Computer Science Mentors @ UC Berkeley
7-
</p>
8+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<p>
2-
Want to unsubscribe? Click <a href="{PROFILE_URL}">here</a> to visit your profile settings.
3-
</p>
1+
<p>Want to unsubscribe? Click <a href="{PROFILE_URL}">here</a> to visit your profile settings.</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {student_name},<br>
3-
&emsp;You have dropped {mentor_name}'s {course_title} section.<br>
4-
Best,<br>
2+
Hi {student_name},<br />
3+
&emsp;You have dropped {mentor_name}'s {course_title} section.<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {mentor_name},<br>
3-
&emsp;{student_name} has dropped your {course_title} section.<br>
4-
Best,<br>
2+
Hi {mentor_name},<br />
3+
&emsp;{student_name} has dropped your {course_title} section.<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {student_name},<br>
3-
&emsp;You have enrolled in {mentor_name}'s {course_title} section!<br>
4-
Best,<br>
2+
Hi {student_name},<br />
3+
&emsp;You have enrolled in {mentor_name}'s {course_title} section!<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {mentor_name},<br>
3-
&emsp;{student_name} has enrolled in your {course_title} section!<br>
4-
Best,<br>
2+
Hi {mentor_name},<br />
3+
&emsp;{student_name} has enrolled in your {course_title} section!<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {student_name},<br>
3-
&emsp;You have swapped into {mentor_name}'s {course_title} section!<br>
4-
Best,<br>
2+
Hi {student_name},<br />
3+
&emsp;You have swapped into {mentor_name}'s {course_title} section!<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {mentor_name},<br>
3-
&emsp;{student_name} has swapped into your {course_title} section!<br>
4-
Best,<br>
2+
Hi {mentor_name},<br />
3+
&emsp;{student_name} has swapped into your {course_title} section!<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>
2-
Hi {mentor_name},<br>
3-
&emsp;{student_name} has swapped out of your {course_title} section.<br>
4-
Best,<br>
2+
Hi {mentor_name},<br />
3+
&emsp;{student_name} has swapped out of your {course_title} section.<br />
4+
Best,<br />
55
Computer Science Mentors @ UC Berkeley
6-
</p>
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<p>
2+
Hi {student_name},<br />
3+
&emsp;You have been successfully removed from the waitlist in {mentor_name}'s {course_title} section!<br />
4+
Best,<br />
5+
Computer Science Mentors @ UC Berkeley
6+
</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<p>
2+
Hi {student_name},<br />
3+
&emsp;You have waitlisted in {mentor_name}'s {course_title} section!<br />
4+
Best,<br />
5+
Computer Science Mentors @ UC Berkeley
6+
</p>

csm_web/scheduler/email/email_errors.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,16 @@ def wrapper(*args):
1919
args = args[:-1]
2020
try:
2121
email_fn(*args)
22-
logger.info(
23-
f"<Email:Success> Email sent"
24-
)
22+
logger.info(f"<Email:Success> Email sent")
2523
except NoEmailError:
26-
logger.info(
27-
f"<Email:Failure> Email address not found"
28-
)
24+
logger.info(f"<Email:Failure> Email address not found")
2925
except EmailFormattingError:
3026
logger.info(
3127
f"<Email:Failure> Email has not been formatted correctly for sending"
3228
)
3329
except EmailAuthError:
34-
logger.info(
35-
f"<Email:Failure> Cannot log into CSM email"
36-
)
30+
logger.info(f"<Email:Failure> Cannot log into CSM email")
3731
except HttpError:
38-
logger.info(
39-
f"<Email:Failure> Email failed to send"
40-
)
32+
logger.info(f"<Email:Failure> Email failed to send")
33+
4134
return wrapper

csm_web/scheduler/email/email_mocks.py

+36-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,27 @@
66
"GMAIL_TOKEN_URI": "token_uri",
77
"GMAIL_CLIENT_ID": "client_id",
88
"GMAIL_CLIENT_SECRET": "client_secret",
9-
"GMAIL_EXPIRY": "expiry"
9+
"GMAIL_EXPIRY": "expiry",
1010
}
1111

1212

1313
class MockCredentials:
1414
"""Mock credentials class modeled after https://google-auth.readthedocs.io/en/stable/reference/google.oauth2.credentials.html"""
1515

16-
def __init__(self, token, refresh_token=None, id_token=None, token_uri=None,
17-
client_id=None, client_secret=None, scopes=None, default_scopes=None,
18-
quota_project_id=None, expiry=None, rapt_token=None):
16+
def __init__(
17+
self,
18+
token,
19+
refresh_token=None,
20+
id_token=None,
21+
token_uri=None,
22+
client_id=None,
23+
client_secret=None,
24+
scopes=None,
25+
default_scopes=None,
26+
quota_project_id=None,
27+
expiry=None,
28+
rapt_token=None,
29+
):
1930
pass
2031

2132
def from_authorized_user_file(filename, scopes=None):
@@ -26,10 +37,22 @@ def from_authorized_user_info(info, scopes=None):
2637
pass
2738

2839

29-
def mock_build(serviceName, version, http=None, discoveryServiceUrl=None,
30-
developerKey=None, model=None, requestBuilder=None, credentials=None,
31-
cache_discovery=True, cache=None, client_options=None, adc_cert_path=None,
32-
adc_key_path=None, num_retries=1):
40+
def mock_build(
41+
serviceName,
42+
version,
43+
http=None,
44+
discoveryServiceUrl=None,
45+
developerKey=None,
46+
model=None,
47+
requestBuilder=None,
48+
credentials=None,
49+
cache_discovery=True,
50+
cache=None,
51+
client_options=None,
52+
adc_cert_path=None,
53+
adc_key_path=None,
54+
num_retries=1,
55+
):
3356
"""Mock build function modeled after https://googleapis.github.io/google-api-python-client/docs/epy/index.html"""
3457
return MockGmailAPI()
3558

@@ -140,7 +163,9 @@ def __init__(self, gmail_api):
140163
self.gmail_api = gmail_api
141164

142165
def execute(self):
143-
message = MockGmailAPI.MockObjects.email_message(len(self.gmail_api.messages), body)
166+
message = MockGmailAPI.MockObjects.email_message(
167+
len(self.gmail_api.messages), body
168+
)
144169
self.gmail_api.messages.append(message)
145170
return message
146171

@@ -174,7 +199,8 @@ def __init__(self, gmail_api):
174199
def execute(self):
175200
return {
176201
"labels": [ # List of labels. Note that each label resource only contains an id, name, messageListVisibility, labelListVisibility, and type. The labels.get method can fetch additional label details.
177-
MockGmailAPI.MockObjects.MOCK_LABEL, MockGmailAPI.MockObjects.MOCK_LABEL
202+
MockGmailAPI.MockObjects.MOCK_LABEL,
203+
MockGmailAPI.MockObjects.MOCK_LABEL,
178204
],
179205
}
180206

0 commit comments

Comments
 (0)