Skip to content

Commit

Permalink
fix: added course_id in email sent event (#35422)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadadeeltajamul authored Sep 5, 2024
1 parent 2c705c9 commit f8bf592
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lms/djangoapps/bulk_email/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def ace_email_sent_handler(sender, **kwargs):
except user_model.DoesNotExist:
user_id = None
course_email = message.context.get('course_email', None)
course_id = course_email.course_id if course_email else None
course_id = message.context.get('course_id')
if not course_id:
course_id = course_email.course_id if course_email else None
tracker.emit(
'edx.bulk_email.sent',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def send_ace_message(goal):
'email': user.email,
'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'course_name': course_name,
'course_id': str(goal.course_key),
'days_per_week': goal.days_per_week,
'course_url': course_home_url,
'goals_unsubscribe_url': goals_unsubscribe_url,
Expand Down
1 change: 1 addition & 0 deletions openedx/core/djangoapps/schedules/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def get_schedules(self):
'week_num': week_num,
'week_highlights': week_highlights,
# This is used by the bulk email optout policy
'course_id': str(course.id),
'course_ids': [str(course.id)],
'unsubscribe_url': unsubscribe_url,
})
Expand Down
1 change: 1 addition & 0 deletions openedx/core/djangoapps/schedules/tests/test_resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def test_schedule_context(self):
'contact_email': '[email protected]',
'contact_mailing_address': '123 Sesame Street',
'course_ids': [str(self.course.id)],
'course_id': str(self.course.id),
'course_name': self.course.display_name,
'course_url': f'http://learning-mfe/course/{self.course.id}/home',
'dashboard_url': '/dashboard',
Expand Down

0 comments on commit f8bf592

Please sign in to comment.