-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcd787c
commit 971b988
Showing
3 changed files
with
39 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,22 +79,21 @@ def email_students_feedback_is_ready_to_view(students: list, notification_messag | |
send_email(student.email, subject, message) | ||
|
||
def send_email(address: str, subject: str, content: str): | ||
return | ||
# try: | ||
# message = EmailMessage() | ||
# message.set_content(content) | ||
# message["To"] = address | ||
# message["From"] = "[email protected]" | ||
# message["Subject"] = subject | ||
|
||
# encoded_message = base64.urlsafe_b64encode(message.as_bytes()).decode() | ||
# create_message = { | ||
# "raw": encoded_message, | ||
# } | ||
# send_message = oauth2_service.users().messages().send(userId="me", body=create_message).execute() | ||
|
||
# except Exception as e: | ||
# raise EmailFailureException(str(e)) | ||
try: | ||
message = EmailMessage() | ||
message.set_content(content) | ||
message["To"] = address | ||
message["From"] = "[email protected]" | ||
message["Subject"] = subject | ||
|
||
encoded_message = base64.urlsafe_b64encode(message.as_bytes()).decode() | ||
create_message = { | ||
"raw": encoded_message, | ||
} | ||
send_message = oauth2_service.users().messages().send(userId="me", body=create_message).execute() | ||
|
||
except Exception as e: | ||
raise EmailFailureException(str(e)) | ||
|
||
|
||
def generate_random_password(length: int): | ||
|