Commit Graph

39 Commits

Author SHA1 Message Date
Calen Pennington
061a46beef Formalize various access roles as objects
This centralizes the logic for group membership, and means that we
don't need to make queries to find out whether the legacy groups names exist.
2013-11-13 13:42:37 -05:00
Brian Wilson
5b48ed840b Refactor subtask creation logic to be less email-specific. 2013-10-28 12:58:11 -04:00
Brian Wilson
0f8f82c845 Define and use SubtaskStatus class. 2013-10-28 12:57:41 -04:00
Brian Wilson
ed4b954a53 Remove the use of celery.group from bulk email subtasks. 2013-10-28 12:47:11 -04:00
Brian Wilson
16b85c0c2a Check for requeued subtasks when in RETRY state. 2013-10-22 18:17:00 -04:00
Brian Wilson
ba6477abef Handle all exceptions returned by django-ses. 2013-10-18 15:12:07 -04:00
Brian Wilson
a699674015 Check that a subtask has not already completed before running. 2013-10-17 13:32:44 -04:00
Sarina Canelake
86c4a03eba admin-console support for enabling email per course 2013-10-16 13:02:41 -04:00
Brian Wilson
b8239068cb Check that email subtasks are known to the InstructorTask before executing. 2013-10-16 13:02:41 -04:00
Brian Wilson
87a72b7e99 Rename some constants, and refactor bulk email task flow. 2013-10-16 13:02:40 -04:00
Brian Wilson
bc599a0662 Update tests with more complete coverage. 2013-10-16 13:02:40 -04:00
Brian Wilson
4505fb4e2c Update InstructorTask before performing a retry. 2013-10-16 13:02:40 -04:00
Brian Wilson
c5debc22e7 Add settings to cap infinite retries. 2013-10-16 13:02:36 -04:00
Brian Wilson
41fcd9627b Don't send emails to students who haven't activated. 2013-10-16 13:02:00 -04:00
Brian Wilson
eaec962de9 Internationalize task progress. 2013-10-16 13:01:59 -04:00
Brian Wilson
df0fba9db8 Add more task-level tests for retries and other errors. Respond to initial comments. 2013-10-16 13:01:59 -04:00
Brian Wilson
a4c35ac4ff Use separate retry count for calculating retry delay. 2013-10-16 13:01:59 -04:00
Brian Wilson
7b7afd472d Incorporate changes in max_retry logic, adding subtask_status as bulk_email arg. 2013-10-16 13:01:59 -04:00
Brian Wilson
08a08448ee Add some handling for SES exceptions. 2013-10-16 13:01:59 -04:00
Brian Wilson
c133fd9168 Use HIGH_PRIORITY_QUEUE for send_course_email. 2013-10-16 13:01:59 -04:00
Brian Wilson
0fd75181e3 Update handling of bulk-email retries to update InstructorTask before each retry. 2013-10-16 13:01:58 -04:00
Brian Wilson
5c29530db9 Factor out subtask-specific code into subtasks.py. 2013-10-16 13:01:58 -04:00
Brian Wilson
01611c33a6 Refactor instructor_task tests, and add handling for general errors in bulk_email subtasks. 2013-10-16 13:01:58 -04:00
Brian Wilson
2f4774f47c Pass status into course_email for tracking retry status. 2013-10-16 13:01:58 -04:00
Brian Wilson
ffbb228acb Add support for counting and reporting skips in background tasks. 2013-10-16 13:01:58 -04:00
Brian Wilson
8fddcdffcd Initial refactoring for bulk_email monitoring. 2013-10-16 13:01:57 -04:00
Carlos Andrés Rocha
ee0004e2f8 Remove dogstatsd-python in favor of dogapi
Also added datadog application to commom django apps and set it to use
a local statsd server by default.
2013-09-11 19:28:58 -04:00
Sarina Canelake
4b9df2e998 Add datadog tracking for bulk email 2013-09-06 16:18:40 -04:00
Sarina Canelake
bfebe684b3 Cleanup bulk email app 2013-09-03 16:11:34 -04:00
Will Daly
1400271b0b Instrumented course email for DataDog 2013-08-30 11:56:15 -04:00
Jason Bau
c160a189ad Bulk email - final tweaks and cleanup 2013-08-29 12:40:34 -04:00
Brian Wilson
8f93051d30 Add editable templates for bulk email
Adds the edX Marketing-approved template as html default.
2013-08-29 12:40:34 -04:00
Jason Bau
d341d6d26d Change optout to use user.id instead of email.
Includes Data + Schema migrations for optout email -> user.id change.
Note that migrations should be reversible.
2013-08-29 12:40:33 -04:00
Sarina Canelake
e6bde93837 Change bulk email model field names and add migrations 2013-08-29 12:40:33 -04:00
Sarina Canelake
b3bc4023b0 Refactor html->plaintext conversion (for bulk email) into separate library 2013-08-29 12:40:33 -04:00
Sarina Canelake
f98d6764b2 Disable bulk email for XML-backed courses 2013-08-29 12:40:32 -04:00
Sarina Canelake
65f7b098dd Bulk Email: Add design styling
Switch to using decorators; refactor and cleanup tests.
2013-08-29 12:40:32 -04:00
Kevin Luo
3b32d4216c Add delay to course bulk 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.
2013-08-29 12:40:32 -04:00
Kevin Luo
907bf6e1b7 Add bulk email feature for instructors, with optout option
Adds a new Email link to the instructor dashboard for frontend interface to send
email to course members. Adds a feature flag ENABLE_INSTRUCTOR_EMAIL to toggle this.
Creates a new djangoapp bulk_email that handles this action by getting the recipient
list and batching the emails to different celery tasks to do the actual sending.
Requires lynx package to convert HTML email to plaintext. Handles SMTP errors by
retrying or falling through to the next email. Adds the option to opt out of course
specific emails in the user dashboard with an Email Settings link for each course.
Uses severable configurable settings with defaults. DEFAULT_BULK_FROM_EMAIL
specifies the from address for email. EMAILS_PER_TASK specifies the number of emails
each celery task takes on. EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER,
EMAIL_HOST_PASSWORD, and EMAIL_USE_TLS for the SMTP email backend settings.

Co-authored-by: Akshay Jagadeesh <akjags@gmail.com>
2013-08-29 12:40:31 -04:00