colorstackorg/oyster

Schedule Pre-event notifications job ๐Ÿ“†

Opened this issue ยท 4 comments

This issue is dependent on #477.
(However, the logic is entirely separate from that issue, so it is possible to work on the PR for this issue before #477 is ready. We just need to make sure #477 is merged first!)

Description

#477 implements a function that sends pre-event notifications to members. However the function isn't being utilized anywhere, so we need to schedule this job. Additionally, we need to ensure that when an event is deleted, this job is also removed from the queue.

Acceptance Criteria

When an event is created, we should schedule a Bull job that calls the function from #477. We want to add to the createEvents function. Specifically, after creating the event, we want to call the job to send an email notification, and then save the job ID within a database field.

Currently, there is no field in the events table for storing this job ID, so that new field needs to be created using a database migration (see docs).

Can I take on this? @tomas-salgado

I can take this too!

@imnotrafa just assigned you to #477, so Iโ€™m going to leave this one for @gpolite0

Can I take this? Following up from the oyster channel on Slack