Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edx changes for schedule emails #109

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lms/djangoapps/bulk_email/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Meta:
SEND_TO_TRACK = 'track'
EMAIL_TARGET_CHOICES = list(zip(
[SEND_TO_MYSELF, SEND_TO_STAFF, SEND_TO_LEARNERS, SEND_TO_COHORT, SEND_TO_TRACK],
['Myself', 'Staff and instructors', 'All students', 'Specific cohort', 'Specific course mode']
['Myself', 'Staff/Administrators', 'All Learners', 'Specific cohort', 'Specific course mode']
))
EMAIL_TARGETS = {target[0] for target in EMAIL_TARGET_CHOICES}

Expand Down
7 changes: 5 additions & 2 deletions lms/djangoapps/instructor/views/instructor_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,13 @@ def _section_send_email(course, access):
'list_email_content', kwargs={'course_id': str(course_key)}
),
}
if settings.FEATURES.get("ENABLE_NEW_BULK_EMAIL_EXPERIENCE", False) is not False:
helper_settings = configuration_helpers.get_value('FEATURES', settings.FEATURES)
if helper_settings.get("ENABLE_NEW_BULK_EMAIL_EXPERIENCE", False) is not False:
mfe_config = configuration_helpers.get_value('MFE_CONFIG', settings.MFE_CONFIG)
communications_mfe_url = settings.COMMUNICATIONS_MICROFRONTEND_URL if "COMMUNICATIONS_MICROFRONTEND_URL" not in mfe_config else mfe_config["COMMUNICATIONS_MICROFRONTEND_URL"]
section_data[
"communications_mfe_url"
] = f"{settings.COMMUNICATIONS_MICROFRONTEND_URL}/courses/{str(course_key)}/bulk_email"
] = f"{communications_mfe_url}/courses/{str(course_key)}/bulk_email"
return section_data


Expand Down
6 changes: 3 additions & 3 deletions lms/djangoapps/instructor/views/instructor_task_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.utils.translation import gettext as _
from django.utils.translation import ngettext

from common.djangoapps.util.date_utils import get_default_time_display
from common.djangoapps.util.date_utils import get_default_time_display, get_time_display
from lms.djangoapps.bulk_email.models import CourseEmail
from lms.djangoapps.instructor_task.views import get_task_completion_info

Expand Down Expand Up @@ -60,7 +60,7 @@ def extract_email_features(email_task):

email = CourseEmail.objects.get(id=task_input_information['email_id'])
email_feature_dict = {
'created': get_default_time_display(email.created),
'created': get_time_display(email.created, coerce_tz="Asia/Kolkata"),
'sent_to': [target.long_display() for target in email.targets.all()],
'requester': str(email_task.requester),
}
Expand Down Expand Up @@ -115,7 +115,7 @@ def extract_task_features(task):
features = ['task_type', 'task_input', 'task_id', 'requester', 'task_state']
task_feature_dict = {feature: str(getattr(task, feature)) for feature in features}
# Some information (created, duration, status, task message) require additional formatting
task_feature_dict['created'] = task.created.isoformat()
task_feature_dict['created'] = get_time_display(task.created, coerce_tz="Asia/Kolkata")

# Get duration info, if known
duration_sec = 'unknown'
Expand Down
Loading