emfcamp / Website

The Electromagnetic Field web site
http://www.emfcamp.org
GNU Affero General Public License v3.0
41 stars 84 forks source link

Email attendees a list of the recorded talks they starred after the event #1767

Open Jonty opened 2 months ago

Jonty commented 2 months ago

Once we reset the website after an event attendees lose the ability to see which talks they starred, which is annoying if you want to go back and watch all the things you didn't see.

Once videos are published it would be nice to email attendees a list of all the talks they starred, with all the ones that were recorded linked + highlighted so they can watch them later.

Bonus nice thing: Attach a file with the ical of the things they starred, just so they have their data.

jayaddison commented 2 months ago

Some initial thoughts on an implementation: perhaps a CLI task that iterates over each login account that has starred events, and for each of those, send an email with a list of hyperlinks to those and then remove the starred-events for that account (a basic method to allow the job to resume without sending multiple duplicate notifications if it fails partway through the process).

Jonty commented 2 months ago

@jayaddison Take a look at how our background email job works for sending emails to all users, this handles recovery https://github.com/emfcamp/Website/blob/888fb8b7d63c7560376bc2d5670b0e46f61fdce0/apps/admin/email.py

We should be able to render the fav list entirely in a template, so all you need to do is enqueue an EmailJob/EmailJobRecipient for every user that has a ticket rendering this new template. https://github.com/emfcamp/Website/blob/888fb8b7d63c7560376bc2d5670b0e46f61fdce0/apps/common/email.py#L136

Ideally we'd like to avoid adding more cli tasks, so it would be nice to have a button somewhere in the interface to fire this off. We probably want to lock it after one run though, unsure what the best way to do that is.

I wouldn't remove the favs from the users purely because we export counts/etc as stats before we nuke the DB, and because people have their personal fav feed set up in ical/etc.

jayaddison commented 2 months ago

Ok; starting (very gradually) on this. Here's what I'm considering so far: