|
4 | 4 | Does not include any access control, be sure to check access before calling.
|
5 | 5 | """
|
6 | 6 |
|
7 |
| - |
8 | 7 | import json
|
9 | 8 | import logging
|
10 | 9 | from contextlib import ExitStack, contextmanager
|
|
61 | 60 |
|
62 | 61 | class EmailEnrollmentState:
|
63 | 62 | """ Store the complete enrollment state of an email in a class """
|
| 63 | + |
64 | 64 | def __init__(self, course_id, email):
|
65 | 65 | # N.B. retired users are not a concern here because they should be
|
66 | 66 | # handled at a higher level (i.e. in enroll_email). Besides, this
|
@@ -434,10 +434,10 @@ def _reset_module_attempts(studentmodule):
|
434 | 434 |
|
435 | 435 |
|
436 | 436 | def _fire_score_changed_for_block(
|
437 |
| - course_id, |
438 |
| - student, |
439 |
| - block, |
440 |
| - module_state_key, |
| 437 | + course_id, |
| 438 | + student, |
| 439 | + block, |
| 440 | + module_state_key, |
441 | 441 | ):
|
442 | 442 | """
|
443 | 443 | Fires a PROBLEM_RAW_SCORE_CHANGED event for the given module.
|
@@ -592,19 +592,17 @@ def send_mail_to_student(student, param_dict, language=None):
|
592 | 592 | user_context=param_dict,
|
593 | 593 | )
|
594 | 594 |
|
595 |
| - render_msg = presentation.render(DjangoEmailChannel, message) |
596 |
| - if not render_msg.body_html.count(student) and message_type == 'allowed_enroll': |
597 |
| - log.error( |
598 |
| - { |
599 |
| - 'message': 'Email template does not contain required email address', |
600 |
| - 'email_address': student, |
601 |
| - 'message_type': message_type, |
602 |
| - 'render_msg': render_msg.body, |
603 |
| - 'count': render_msg.body_html.count(student), |
604 |
| - 'lms_user_id': lms_user_id, |
605 |
| - **param_dict |
606 |
| - } |
607 |
| - ) |
| 595 | + if message_type == 'allowed_enroll': |
| 596 | + log_data = { |
| 597 | + 'message': 'allowed_enroll email data log', |
| 598 | + 'message_type': message_type, |
| 599 | + 'student': student, |
| 600 | + 'recipient': message.recipient.email_address, |
| 601 | + 'context_email': message.context.get('email_address'), |
| 602 | + 'lms_user_id': lms_user_id, |
| 603 | + **param_dict |
| 604 | + } |
| 605 | + log.error(log_data) |
608 | 606 | ace.send(message)
|
609 | 607 |
|
610 | 608 |
|
|
0 commit comments