From 1103544a079ddc8b9f78c72f9a4c7bf9b66f5e5a Mon Sep 17 00:00:00 2001 From: Muhammad Adeel Tajamul <77053848+muhammadadeeltajamul@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:04:01 -0700 Subject: [PATCH] feat: added user email in email sent event data (#35456) --- lms/djangoapps/bulk_email/signals.py | 1 + lms/djangoapps/bulk_email/tasks.py | 2 +- lms/djangoapps/bulk_email/views.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/bulk_email/signals.py b/lms/djangoapps/bulk_email/signals.py index 086b3636f7ef..9f6540651eeb 100644 --- a/lms/djangoapps/bulk_email/signals.py +++ b/lms/djangoapps/bulk_email/signals.py @@ -55,5 +55,6 @@ def ace_email_sent_handler(sender, **kwargs): 'channel': channel, 'course_id': course_id, 'user_id': user_id, + 'user_email': message.recipient.email_address, } ) diff --git a/lms/djangoapps/bulk_email/tasks.py b/lms/djangoapps/bulk_email/tasks.py index 0152d14ff01f..2b96af786a97 100644 --- a/lms/djangoapps/bulk_email/tasks.py +++ b/lms/djangoapps/bulk_email/tasks.py @@ -533,7 +533,7 @@ def _send_course_email(entry_id, email_id, to_list, global_email_context, subtas email_context['email'] = email email_context['name'] = profile_name email_context['user_id'] = user_id - email_context['course_id'] = course_email.course_id + email_context['course_id'] = str(course_email.course_id) email_context['unsubscribe_link'] = get_unsubscribed_link(current_recipient['username'], str(course_email.course_id)) diff --git a/lms/djangoapps/bulk_email/views.py b/lms/djangoapps/bulk_email/views.py index 7ee3ea81b19a..f63010d13a90 100644 --- a/lms/djangoapps/bulk_email/views.py +++ b/lms/djangoapps/bulk_email/views.py @@ -64,6 +64,7 @@ def opt_out_email_updates(request, token, course_id): event_name = 'edx.bulk_email.opt_out' event_data = { "username": user.username, + "user_email": user.email, "user_id": user.id, "course_id": course_id, }