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

Fix: Pass preferences parameter to generateAlertEmailContent in air-quality-alerts-job #4206

Open
coderabbitai bot opened this issue Jan 18, 2025 · 0 comments
Assignees

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2025

Issue Description

The generateAlertEmailContent function in src/auth-service/bin/jobs/air-quality-alerts-job.js expects three parameters: spikes, userName, and preferences. However, in the current implementation, only two arguments are being passed when calling this function, which could lead to runtime errors when the function tries to access the preferences parameter.

Current Implementation

const emailPromises = batch.map(async ({ user, spikes }) => {
  const content = generateAlertEmailContent(spikes, user.firstName);

Expected Implementation

const emailPromises = batch.map(async ({ user, spikes, preferences }) => {
  const content = generateAlertEmailContent(spikes, user.firstName, preferences);

Impact

  • Potential runtime errors when accessing preferences data
  • Incorrect threshold values in email alerts
  • Missing site-specific preferences in the generated email content

References

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

No branches or pull requests

1 participant