Overview
The notifier is used to send html or plain text digest emails of unread messages to Discussions followers. See the Devops Notifier Context additional details.
Here you will find the code for the notifer.
There is a separate repository named edx-notifications. This repo is under development, but not actively being developed or used at this time by edx.org for forums notifications.
Testing
Follow these instructions for receiving digest emails.
To manually test on Stage:
- Follow instructions above to receive digests
- Make a change in Discussions that would be sent through the digest
- Notifications are scheduled to be sent every 5 minutes, so wait a bit.
- Verify the following:
make sure you retrieve an email (i.e. checks scheduler is finding users and finding updates for digests)
make sure the html output looks good
if the text contains Markdown, it will come as-is (e.g. ** non bold test **)
make sure the text output looks good (in gmail, choose the dropdown next to email ("More" tooltip) and select "Message text garbled?")
Testing and Troubleshooting in Devstack
Run LMS (a dependency)
sudo su edxapp paver devstack lms [--fast]
Run Forums
sudo su forum ruby app.rb -p 18080
Test Notifier (change to-date to an appropriate future date)
sudo su notifier /edx/app/notifier/virtualenvs/notifier/bin/python /edx/app/notifier/src/manage.py forums_digest --help /edx/app/notifier/virtualenvs/notifier/bin/python /edx/app/notifier/src/manage.py forums_digest --to_datetime=2015-11-13 --show-html
Testing and Troubleshooting in a production like environment (sandboxes and up)
You'll want to have two users, one posts and follows the post, the other comments on the post, then you can run the --users=firstuserid command below to see what notifier would do.
You'll want to set {{to_datetime}} to the current date + 1 day (this is important - the forums_digest management command defaults to only look back one from the the {{to_datetime}} variable in determining which threads/posts need to have digests created).
sudo su notifier /edx/app/notifier/virtualenvs/notifier/bin/python /edx/app/notifier/src/manage.py forums_digest --help /edx/app/notifier/virtualenvs/notifier/bin/python /edx/app/notifier/src/manage.py forums_digest --to_datetime=2015-11-13 --show-html OR (to limit the search to a single user) /edx/app/notifier/virtualenvs/notifier/bin/python /edx/app/notifier/src/manage.py forums_digest --to_datetime=2015-11-13 --show-html --users=12345