private Notification BuildBrowserNotification(ReportAddedToIncident e, NewSpike countToday,
                                                      UserNotificationSettings setting)
        {
            var notification =
                new Notification(
                    $"Coderr have received {countToday.SpikeCount} reports so far. Day average is {countToday.DayAverage}.")
            {
                Title   = $"Spike detected for {e.Incident.ApplicationName}",
                Actions = new List <NotificationAction>
                {
                    new NotificationAction
                    {
                        Title  = "View",
                        Action = "discoverApplication"
                    }
                },
                Data = new
                {
                    applicationId           = e.Incident.ApplicationId,
                    accountId               = setting.AccountId,
                    discoverApplicationUrlk = $"{_baseConfiguration.BaseUrl}/discover/{e.Incident.ApplicationId}"
                },
                Timestamp = e.Report.CreatedAtUtc
            };

            return(notification);
        }
        private EmailMessage BuildEmail(ReportAddedToIncident e, UserNotificationSettings setting, NewSpike countToday)
        {
            var msg = new EmailMessage(setting.AccountId.ToString())
            {
                Subject  = $"Spike detected for {e.Incident.ApplicationName} ({countToday} reports)",
                HtmlBody =
                    $"We've detected a spike in incoming reports for application <a href=\"{_baseConfiguration.BaseUrl}discover/{e.Incident.ApplicationId}/\">{e.Incident.ApplicationName}</a>\r\n" +
                    "\r\n" +
                    $"We've received {countToday.SpikeCount} reports so far. Day average is {countToday.DayAverage}\r\n" +
                    "\r\n" + "No further spike emails will be sent today for this application."
            };

            return(msg);
        }