Only one approval reminder email per user per issue
This commit is contained in:
parent
62a805374f
commit
2d94b26d3c
@ -58,6 +58,8 @@ public class ApprovalNotificationWorker : IJob {
|
||||
|
||||
IEnumerable<Approval> approvals = await _approvalService.GetActiveApprovalsWithNotificationOlderThanFiveDays();
|
||||
|
||||
HashSet<string> issueAndUserIds = new();
|
||||
|
||||
foreach (Approval approval in approvals) {
|
||||
bool isEcn = false;
|
||||
bool isCa = false;
|
||||
@ -113,7 +115,8 @@ public class ApprovalNotificationWorker : IJob {
|
||||
|
||||
if ((isEcn || isCa || isMrb || isPcrb) &&
|
||||
!string.IsNullOrWhiteSpace(title) &&
|
||||
!string.IsNullOrWhiteSpace(url)) {
|
||||
!string.IsNullOrWhiteSpace(url) &&
|
||||
!issueAndUserIds.Contains($"{approval.IssueID}{approval.UserID}")) {
|
||||
|
||||
User user = await _userService.GetUserById(approval.UserID);
|
||||
|
||||
@ -139,6 +142,8 @@ public class ApprovalNotificationWorker : IJob {
|
||||
|
||||
approval.NotifyDate = DateTime.Now;
|
||||
await _approvalService.UpdateApproval(approval);
|
||||
|
||||
issueAndUserIds.Add($"{approval.IssueID}{approval.UserID}");
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user