Commit 72f09cf3 by Kevin Luo

Add delay to course email task and use SITE_NAME for site url

 Delay for possible race condition with fetching course email object.
 Use settings.SITE_NAME for host name to generate email footer url.
parent 2e30a326
......@@ -63,7 +63,7 @@ def delegate_email_batches(hash_for_msg, recipient, course_id, course_url, user_
for i in range(num_workers):
to_list = recipient_list[i * chunk:i * chunk + chunk]
course_email.delay(hash_for_msg, to_list, course.display_name, course_url, False)
course_email.apply_async(args=[hash_for_msg, to_list, course.display_name, course_url, False], countdown=10)
return num_workers
......
......@@ -3,4 +3,4 @@
----<br />
This email was automatically sent from ${settings.PLATFORM_NAME} to ${name}. <br />
You are receiving this email at address ${ email } because you are enrolled in <a href="${course_url}">${ course_title }</a>.<br />
To stop receiving email like this, update your course email settings <a href="https://${site}${reverse('dashboard')}">here</a>. <br />
To stop receiving email like this, update your course email settings <a href="https://${settings.SITE_NAME}${reverse('dashboard')}">here</a>. <br />
......@@ -4,4 +4,4 @@
This email was automatically sent from ${settings.PLATFORM_NAME} to ${name}.
You are receiving this email at address ${ email } because you are enrolled in ${ course_title }
(URL: ${course_url} ).
To stop receiving email like this, update your account settings at https://${site}${reverse('dashboard')}.
To stop receiving email like this, update your account settings at https://${settings.SITE_NAME}${reverse('dashboard')}.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment