Skip to content

feat: send email notifications to DAU newly added to a proposal#1626

Open
shivoomiess wants to merge 7 commits into
developfrom
SWAP-5655-notify-DAU
Open

feat: send email notifications to DAU newly added to a proposal#1626
shivoomiess wants to merge 7 commits into
developfrom
SWAP-5655-notify-DAU

Conversation

@shivoomiess

@shivoomiess shivoomiess commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds the feature to send email notifications to Data Access User (DAU) when they are newly added to a proposal.

Motivation and Context

This change is required to ensure that newly added DAUs are promptly notified about their addition to a proposal, thereby improving communication and efficiency.

Changes

  1. An enum for 'DATA_ACCESS_USER_ADDED' has been added to the email template IDs.
  2. A case for 'DATA_ACCESS_USERS_UPDATED' event has been added to the email handler. It sends emails to only the newly added users and skips if no new users are added.
  3. An 'invitedUserIds' field has been added to the 'UserDataAccessUpdatedEvent' interface to keep track of newly invited users.
  4. 'DataAccessUsersMutations' class has been updated to capture the current members before updating the data access users, to work out who is genuinely newly invited.

How Has This Been Tested

This has been tested by verifying that email notifications are sent out accurately to newly added DAUs, and no notifications are sent out in case of no new additions. Error handling has been implemented to log an error message if an email could not be sent.

The logs confirm this is the case:
Proof of Email sent in logs

Fixes Jira Issue

https://jira.ess.eu//browse/SWAP-5655

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@shivoomiess
shivoomiess requested a review from a team as a code owner July 6, 2026 09:35
@shivoomiess
shivoomiess requested review from ACLay and removed request for a team and ACLay July 6, 2026 09:35
@shivoomiess shivoomiess changed the title add: send email notifications to DAU newly added to a proposal feat: send email notifications to DAU newly added to a proposal Jul 6, 2026

@jekabs-karklins jekabs-karklins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - one minor change request.

Non-blocking thought: wiring this only into essEmailHandler means any other facility wanting the same notification has to reimplement a near-identical handler. Might be worth rethinking the email-handling structure so common cases live in one place while facilities can still add their own. Follow-up, not for this PR.

Comment thread apps/backend/src/events/applicationEvents.ts Outdated
@yoganandaness
yoganandaness requested review from simonfernandes and zacharyjhankin and removed request for janosbabik July 20, 2026 09:28
@shivoomiess
shivoomiess enabled auto-merge (squash) July 22, 2026 08:57
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.

4 participants