Skip to content

Diya 🔥 fix(resendBS): Fixed Manual Resend Blue Square Emails#2250

Merged
one-community merged 1 commit into
developmentfrom
Diya_Fix_ResendManualBSEmails
Jun 17, 2026
Merged

Diya 🔥 fix(resendBS): Fixed Manual Resend Blue Square Emails#2250
one-community merged 1 commit into
developmentfrom
Diya_Fix_ResendManualBSEmails

Conversation

@DiyaWadhwani

Copy link
Copy Markdown
Contributor

Description

Fixes the resendBlueSquareEmailsOnlyForLastWeek function which was crashing on every
invocation, causing the Resend Blue Square Emails button to silently fail.

Implements # (Resend Blue Square Emails button - BlueSquareEmailManagement page)

Related PRs:

None

Main changes explained:

  • userHelper.js — Fixed resendBlueSquareEmailsOnlyForLastWeek:
    • Replaced undefined TimeLog reference with the already-imported timeEntries model
    • Fixed typo weeklyComittedHoursweeklycommittedHours
    • Added field projection to userProfile.find() so infringements is included in results
    • Fixed variable ordering (variables were referenced before being defined)
    • Added function to the return block (was missing, so controller couldn't call it)

How to test:

  1. Check out this branch and start the backend locally
  2. Start the frontend and log in as an admin user with resendBlueSquareAndSummaryEmails permission
  3. Navigate to the Blue Square Email Management page
  4. Click Resend Blue Square Emails and confirm the modal
  5. Check backend logs — you should see:
[API Trigger] Manual blue square email resend
[resend] Looking for infringements between YYYY-MM-DD and YYYY-MM-DD
[resend] Found X users with infringements

Screenshots or videos of changes:

Screenshot 2026-06-16 at 7 42 33 PM

Notes:

  • API returns 202 immediately; email logic runs in background via setImmediate.
    Check server logs to confirm delivery, not the API response.
  • In dev/staging, emails are blocked by the non-production environment check in
    emailSender — this is expected behavior.

@one-community one-community changed the title Diya fix(resendBS): Fixed Manual Resend Blue Square Emails Diya 🔥 fix(resendBS): Fixed Manual Resend Blue Square Emails Jun 17, 2026
@one-community one-community merged commit 57022ab into development Jun 17, 2026
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.

2 participants