Added cron job to send a link to open the door #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
npm run cronchecks all upcoming events in the next 60 minutes and sends an email (usingRESEND_API_KEY) to all attendees like this one:The link then when the user clicks that link less than 15mn before the event, they will see this:
Then during the event (with a 15mn buffer), they will see this:
And the door will open and a message is sent to the #door channel on discord ($name opened the door for Crypto Wednesday).
Also took the opportunity to refactor the code and add some test cases.
Behind the scene, it generates a private key for the server and uses it to sign the url to open the door (so that it cannot be tempered with). That URL contains the name of the guest,
eventUrland the time and duration of the event. This makes sure nobody can generate such URL to open the door and that we keep track of who is opening the door.Next step: automatically check people in using luma api.