Enable Course Bulk Emails

I enabled the Course Bulk Email Feature on Open Edx following this document

https://edx.readthedocs.io/projects/open-edx-release-notes/en/latest/bulk_email.html#changing-the-bulk-email-setting

But when i try to send email nothing happens and the log shows the following:

Received unregistered task of type u'bulk_email.tasks.send_course_email'.

How to add this task to Tutor?

The following configuration in the config.yml worked for me to send validation emails.

SMTP_HOST: mail.example.com
SMTP_PASSWORD: xxxx
SMTP_PORT: 587
SMTP_USERNAME: noreply-example@example.com
SMTP_USE_TLS: true

This is strange… From what I understand, bulk emails are not supposed to be sent from the CMS (“bulk_email” is not in the CMS installed applications), yet it is the CMS worker which is picking up the celery task. This might be another instance of weird celery queue routing… It’s difficult to understand what is going on here if you don’t precisely describe what you are doing to send a bulk email.

Hi!

Bellow the steps to reproduce

  1. I enable a feature like documentation

  2. I went to the LMS in the Instructor> Email section

  3. And I sent the message by selecting the “Send to myself” option

  4. And nothing happened

Tks

What are the logs from the “smtp” container?

Hi!
Nothing on logs of SMTP container

In the lms-worker container

And in the cms-worker container

It looks like the task is being directed to the cms-worker container

@regis is this a bug in openedx?

I would love to be able to use this feature :frowning:

Can you please describe more precisely how to reproduce this issue? How did not understand what you meant by “I enable a feature like documentation”. Also, I find no “Instructor> Email section” in the LMS.

Hi, @regis

I followed the instructions below

  1. Sign in to the Django administration console for your base URL. For example, http://{your_URL}/admin .
  2. In the Bulk_Email section, next to Bulk email flags , select Add .
  3. To enable the bulk email feature, select the Enabled check box.To disable the bulk email feature, clear the Enabled check box.
  4. If you previously set REQUIRE_COURSE_EMAIL_AUTH: True , select the Require course email auth check box.
  5. At the bottom of the page, select Save .

Then “Instructor> Email section” appears in the LMS

Tks

@ejklock,
I managed to reproduce this issue and I tried to debug this. It’s baffling: 50% of the time the task is routed to the LMS worker, and in the other 50% the task is routed to the CMS worker. Can you open an issue on the Tutor github repo that precisely explains how to reproduce this issue, what is the expected outcome, and what is the observed result? Please include copy-pasted logs, and not screen captures. Also, add a link to this conversation.
I’ll also attempt to reproduce this in Juniper, as this might not be a problem anymore in the next release.

For the record, a possible explanation might be that the ‘edx.lms.core.default’ queue is included both in the LMS and the CMS workers.

LMS:

>>> settings.CELERY_QUEUES
{'edx.lms.core.high': {}, 'edx.lms.core.high_mem': {}, 'edx.lms.core.default': {}}                                                                           
>>> 

CMS:

>>> settings.CELERY_QUEUES
{'edx.cms.core.high_mem': {}, 'edx.cms.core.high': {}, 'edx.cms.core.default': {}, u'edx.lms.core.default': {}}

(note for self: it is very likely that this is linked to https://github.com/overhangio/tutor/issues/302#issuecomment-613573142. In the CMS we have settings.ALTERNATE_QUEUES = [u'edx.lms.core.default'])

A post was split to a new topic: Sending bulk email triggers SMTPRecipientsRefused error

For the record, my tests show that this issue does not occur anymore in Lilac.

On a related note, I discovered that bulk emails look absolutely terrible and contains tons of references to edX. I opened a corresponding issue: https://github.com/overhangio/tutor/issues/485