Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: backend for sending event reminders 📆 #524

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

imnotrafa
Copy link

@imnotrafa imnotrafa commented Sep 25, 2024

Description ✏️

Closes #477

  • Returns a list of undergrad student emails who are not registered for a given event.
  • Finds the event attendees and filters down those students who are not attending.
  • Currently using an existing email template thus email template must be changed accordingly.

Type of Change 🐞

  • Feature - A non-breaking change which adds functionality.
  • Fix - A non-breaking change which fixes an issue.
  • Refactor - A change that neither fixes a bug nor adds a feature.
  • Documentation - A change only to in-code or markdown documentation.
  • Tests - A change that adds missing unit/integration tests.
  • Chore - A change that is likely none of the above.

Checklist ✅

  • I have done a self-review of my code.
  • I have manually tested my code (if applicable).
  • I have added/updated any relevant documentation (if applicable).

Copy link
Collaborator

@tomas-salgado tomas-salgado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @imnotrafa! I really like how you implemented the algorithm within this function-it's logical and easy to follow. Left a few comments, let me know if you have any questions!

- Meron-b
- gxsoto
- mcdev92
- angel-romero-f
- Ekene-Azubuko
- Dharld
- rod608
- mdg258
- mdg258
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who's mdg258? We should only be adding your own GitHub username in this PR.

Also, make sure that there is exactly 1 blank line at the end of the file (that's what the red circle is signifying is missing)

@@ -0,0 +1,40 @@
import { db } from '@oyster/db';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this file to send-event-reminder to stay consistent with the naming pattern of the other files in this directory

},
});
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of this PR, let's also create the template for the email-specifically event-reminder.tsx which can be placed in packages/email-templates/emails/application-created.tsx. Don't worry too much about all the wording details, but do try to have a general structure similar to the other emails in the emails directory.

This will also requiring adding the reference to the new email template in the right places throughout packages/core/src/modules/notification/use-cases/send-email.ts.

//Must change the name of the email template being used based on the prupose of the function
//TODO: create an email tenplate for event reminders
unregisteredStudents.forEach((student) => {
sendEmail({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might face an issue here. Since we're sending so many emails, we'll need to make sure we adhere to any email rate limits imposed by Postmark (which is what we use to send emails). Doing some research gives more precise limits.

However, the logic for sending email batches adhering to rate limits should be done as a worker separate from this function, so we can have this done as part of a separate issue. No worries if you don't want to take this on right now.

I'll also tag @ramiAbdou in case he has any more feedback regarding this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take on this new issue right away if possible.

@tomas-salgado tomas-salgado changed the title First contribution Attempt 2 feat: backend for sending event reminders 📆 Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infrastructure for Pre-event notifications 🔔
2 participants