new mailling for not confirmed emails

This commit is contained in:
Paul Schneider 2021-05-30 12:30:39 +01:00
commit 45d76a2917
25 changed files with 46 additions and 31 deletions

View file

@ -61,9 +61,9 @@ namespace cli.Services
}
public void SendMonthlyEmail(long templateCode, string baseclassName = DefaultBaseClassName)
public void SendEmailFromCriteria(long templateCode, Func<ApplicationUser,bool> criteria)
{
string className = "Generated" + baseclassName;
string className = "GeneratedTemplate";
string subtemp = stringLocalizer["MonthlySubjectTemplate"].Value;
@ -156,7 +156,7 @@ namespace cli.Services
throw new InvalidOperationException("No generated template");
}
foreach (var user in dbContext.ApplicationUser.Where(
u => u.AllowMonthlyEmail
u => criteria(u)
))
{
logger.LogInformation("Generation for " + user.UserName);
@ -172,15 +172,10 @@ namespace cli.Services
logger.LogError($"{mailSentInfo.ErrorMessage}");
else
logger.LogInformation($"mailId:{mailSentInfo?.MessageId} \nto:{user.UserName}");
}
}
}
}
}
}
}