Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public UserSettings GetUserSettings(int userId)
        {
            DatabaseUser databaseUser = _dbQueryService.GetUserById(userId);

            return(new UserSettings(databaseUser));
        }