You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is unclear to me if we should use keep it simple with an smtp server, or go more complex with integrating the gmail api.
The plan with that task:
Add some card to the profile page that has a bunch of checkboxes for opting into different email events (like when assignment are released, about to be due without a submission, lecture notes published, notifications from instructors...)
Extend the anubis.models.InCourse to include boolean values for these email preferences. (We put it on the InCourse table so preferences are specific to the course)
Add endpoints to anubis.views.public.profile for changing the opt-in email values. (Maybe some admin views too for changing a whole class email preferences).
Add rpc functions for sending out email notifications.
Use the scheduling features of rq to schedule email notifications functions. We could then schedule assignment notifications to run when those two views I mentioned earlier are run.
We probably need to also add some kind of notification tracking as a table in the database. Without that we may accidentally send notifications twice, or not at all if something gets wonked when we are sending.
There are a couple of gotchas that we will need to handle:
If we are scheduling notification rpc jobs, we will need to confirm that the timing is still correct when the job is run.
We also need this system to be fault tolerant. The rpc job queues are stored in redis. Redis is meant to not be persistent in Anubis. If redis is restarted or the container is lost or destroyed for any reason, everything on it will be lost (including jobs in the queues). Normally jobs live in queues for no more than 60-120 seconds, so there is normally no issue. My worry with scheduling jobs is that we would need to be able to detect and re-enqueue scheduled jobs if they are lost.
An alternative to scheduling notification rpc jobs is just adding a function to detect when notifications need to be sent out, and put it in a k8s CronJob that could be run every 5 minutes or so. We could then enqueue jobs to send out the notifications from there. This setup would be much more fault tolerant than scheduling rpc notification jobs.
Then the last thing is that I have not decided if I want to use the google gmail api, or just a simple smtp server setup. In Anubis version 0.0.1 back in January of 2020 there was no website. I sent out emails for every submission to students via a simple smtp server setup. We ended up getting rate limited by gmail in the like 3 hours before the deadline in that first assignment. i.e. emails were not being delivered to students. Then alternatively maintaining google api credentials is just annoying. I have done it in k8s before and could copy some code over, but it is just more annoying than something simple like an smtp server.
The text was updated successfully, but these errors were encountered:
Like:
It is unclear to me if we should use keep it simple with an smtp server, or go more complex with integrating the gmail api.
The plan with that task:
There are a couple of gotchas that we will need to handle:
An alternative to scheduling notification rpc jobs is just adding a function to detect when notifications need to be sent out, and put it in a k8s CronJob that could be run every 5 minutes or so. We could then enqueue jobs to send out the notifications from there. This setup would be much more fault tolerant than scheduling rpc notification jobs.
Then the last thing is that I have not decided if I want to use the google gmail api, or just a simple smtp server setup. In Anubis version 0.0.1 back in January of 2020 there was no website. I sent out emails for every submission to students via a simple smtp server setup. We ended up getting rate limited by gmail in the like 3 hours before the deadline in that first assignment. i.e. emails were not being delivered to students. Then alternatively maintaining google api credentials is just annoying. I have done it in k8s before and could copy some code over, but it is just more annoying than something simple like an smtp server.
The text was updated successfully, but these errors were encountered: