Has anyone had a problem with sending scheduled emails from lms Instructor-Email (new experience) tab?
Emails send with option “Send email” arrive without any problems. Emails send with options “Schedule this email for a futore date” do not arrive.
Emails are “SCHEDULED” but this status is always the same, no matter if the time of schedule sending is passed.
Hi @maciej-k I think this is an issue with the bulk email MFE, I think it requires a queuing system that may not be set up by default.
@arbrandes sorry to bring you in but I was talking with you about this in Quince and never got an answer about whether or not bulk email MFE works, scheduling email works, or how to set it all up.
Totally fair. Only thing is that I haven’t gotten around to actually test this, yet, so I don’t have a solution off the top of my head. I’ll (finally) try it out this week and get back to this thread.
In the meantime, @Felipe, I figure you actually use this at eduNext. Anybody over there have any tips?
So there is this send_email function that is being called to send these email.
It then uses the task_api.submit_bulk_course_email to request to have bulk email sent as a background task, and this function takes the scheduled time if any.
An instructor scheduled task is created with schedule state as SCHEDULEDhere.
Then there is this API, process_scheduled_instructor_tasks which seems to handle this using celery, but that function is not getting called.
This is the only page I see that function is being called in, which would allow us to do tutor local exec lms ./manage.py lms process_scheduled_instructor_tasks :
"""
Command to process scheduled instructor tasks.
"""
from django.core.management.base import BaseCommand
from lms.djangoapps.instructor_task.api import process_scheduled_instructor_tasks
class Command(BaseCommand):
"""
Command to process Instructor Tasks in the `SCHEDULED` state that are due for execution.
"""
def handle(self, *args, **options):
process_scheduled_instructor_tasks()
One more update that I scheduled an email and at the time I scheduled, by default it didn’t process the email. But I ran the command after which I received the email.
Hi everyone, reviewing this problem I found this documentation: Processing Scheduled Instructor Tasks where it says that the task scheduling has to be done by command (just like the command that says @zameel7) and it has to be done through a job (cron type). I created a test with a cronjob that performs this command every 15 minutes and it worked as expected.
Is that a good solution as said in that link? It asks to set a cronjob every 15 minutes. If that is the case, we will have to restrict users to choose time only in interval of 15 minutes right?
We don’t make much noise about it because as Beto mentioned, it needs an annoying cron to schedule the task continuously.
Ideally we should either refactor the features that need a cron to do periodic tasks or have a proper scheduler that handles well all of them. I tried proposing the latter when doing the survey report work but having an official scheduder was rejected by the community.