private bool SendAlertTriggeredEmail(DatabaseAlert alert, DatabasePerSecondStat earliestStatThatTriggersAlert) { DatabaseUser databaseUser = _databaseQueryService.GetUserById(alert.UserId); if (!databaseUser.EmailAddress.IsNullOrEmpty()) { string emailSubject = GetEmailSubject(alert, earliestStatThatTriggersAlert); string emailBody = GetEmailBody(alert, earliestStatThatTriggersAlert, databaseUser); return(_emailService.SendEmail(databaseUser.EmailAddress, emailSubject, emailBody)); } return(false); }
public UserSettings GetUserSettings(int userId) { DatabaseUser databaseUser = _dbQueryService.GetUserById(userId); return(new UserSettings(databaseUser)); }