-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #999 from OneCommunityGlobal/development
Backend Release to Main [1.82]
- Loading branch information
Showing
2 changed files
with
5 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
const moment = require('moment-timezone'); | ||
const mongoose = require('mongoose'); | ||
const logger = require('../startup/logger'); | ||
const { getInfringementEmailBody } = require('../helpers/userHelper')(); | ||
const UserProfile = require('../models/userProfile'); | ||
const Project = require('../models/project'); | ||
const Task = require('../models/task'); | ||
|
@@ -329,7 +328,7 @@ const addEditHistory = async ( | |
description: `${totalRecentEdits} time entry edits in the last calendar year`, | ||
}); | ||
|
||
const infringementNotificationEmail = ` | ||
const infringementNotificationToAdminEmailBody = ` | ||
<p> | ||
${userprofile.firstName} ${userprofile.lastName} (${userprofile.email}) was issued a blue square for editing their time entries ${totalRecentEdits} times | ||
within the last calendar year. | ||
|
@@ -339,28 +338,20 @@ const addEditHistory = async ( | |
</p> | ||
`; | ||
|
||
const emailInfringement = { | ||
date: moment().tz('America/Los_Angeles').format('MMMM-DD-YY'), | ||
description: `You edited your time entries ${totalRecentEdits} times within the last 365 days, exceeding the limit of 4 times per year you can edit them without penalty.`, | ||
}; | ||
const infringementNotificationToUserEmailBody = `You edited your time entries ${totalRecentEdits} times within the last 365 days, exceeding the limit of 4 times per year you can edit them without penalty.`; | ||
|
||
pendingEmailCollection.push( | ||
emailSender.bind( | ||
null, | ||
'[email protected]', | ||
`${userprofile.firstName} ${userprofile.lastName} was issued a blue square for for editing a time entry ${totalRecentEdits} times`, | ||
infringementNotificationEmail, | ||
infringementNotificationToAdminEmailBody, | ||
), | ||
emailSender.bind( | ||
null, | ||
userprofile.email, | ||
"You've been issued a blue square for editing your time entry", | ||
getInfringementEmailBody( | ||
userprofile.firstName, | ||
userprofile.lastName, | ||
emailInfringement, | ||
userprofile.infringements.length, | ||
), | ||
infringementNotificationToUserEmailBody, | ||
), | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters