Skip to content

Conversation

@kevin-lann
Copy link
Contributor

@kevin-lann kevin-lann commented Mar 19, 2025

Description

SCRUM-56

This PR Includes:

  • Email Notifications for upcoming course events
    • Ran every 1 min by server
    • If an event is starting within the next 15 min then notify the user to which that event belongs to by email
  • User is able to toggle notifications on and off for individual timetables using the kebab menu
  • Unit tests for email notifications

Screenshots
image

image

HOW TO TEST
Update env varirables in backend (in pinned msg on discod)
Since all of our course events are in the future (Summer 2025 at earliest) we have to mock the current date to test.
Go to /backend/constants/constants.ts and modify these variables:

// true - notifications will be tested by mocking current Date
// false - normal application behavior
export const TEST_NOTIFICATIONS = false;
// Mock the current date
// Note: month index in date constructor is 0 indexed (0 - 11)
export const TEST_DATE_NOW = new Date(2025, 4, 14, 8, 45, 1);

In this example, we are pretending the current date is Wed May 14th, 2025 at 8:45:01 am
Note that month index is 0 indexed (0-11)

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@kevin-lann kevin-lann marked this pull request as draft March 19, 2025 22:18
@kevin-lann kevin-lann marked this pull request as ready for review March 19, 2025 23:23
Copy link
Contributor

@thomasyzy7 thomasyzy7 left a comment

Choose a reason for hiding this comment

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

Cancel button doesn't work.

Also I got 13 emails at the same time when doing notifications

@kevin-lann kevin-lann requested a review from thomasyzy7 March 20, 2025 18:40
Copy link
Contributor

@thomasyzy7 thomasyzy7 left a comment

Choose a reason for hiding this comment

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

Now, we need to prevent the same email from sending multiple times.

@thomasyzy7 thomasyzy7 merged commit ad6c9c3 into develop Mar 20, 2025
2 checks passed
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.

3 participants