icssc / zotnfound-frontend

ZotNFound.com
2 stars 1 forks source link

Feat: Unsubscribe from email notifications #21

Closed stevem-zhou closed 8 months ago

stevem-zhou commented 8 months ago

How to find the bug:

Why is this:

How to fix:

Resources:

tyleryy commented 8 months ago

Do I need access to the Firebase project to complete this issue? I would like to see the database tables

stevem-zhou commented 8 months ago

Do I need access to the Firebase project to complete this issue? I would like to see the database tables

You don't need the Firebase project to complete this. To see the database table, you can use pgAdmin with the .env info, or Postman and use a get request on the leaderboard to see the data that it gives back or also the DB document in our ZotnFound drive! Let me know if you need anything else =D

tyleryy commented 8 months ago

Where and when do you send emails? Is it when a new item is placed? So is it called in the create new items route? And also what causes the emails to be sent out to everyone? Do you query all the users and call sendEmail on each? I think filtering the list off one query retrieving all users who are subscribed be the best approach because if we did at the user level we would have to call a query for each user.

NwinNwin commented 8 months ago

Yes you're correct! We send email in backend when a new item is created. We query all user email in leaderboard table to send to everyone in it.

tyleryy commented 8 months ago

Ooh ic ic, thank you! I completely missed it cause of the nearbyItems name lol.