private void SendNotifications(IEnumerable <EmailNotification> pendingNotifications)
        {
            if (!pendingNotifications.Any())
            {
                return;
            }

            using (var smtpClient = new SmtpClient(_settings.Host, _settings.Port))
            {
                smtpClient.EnableSsl = true;

                foreach (var notification in pendingNotifications)
                {
                    smtpClient.Credentials = new NetworkCredential(_settings.Username, _settings.Password);

                    var message = new MailMessage
                    {
                        From       = _settings.From.ToMailAddress(),
                        Subject    = notification.Subject,
                        Body       = notification.Message,
                        IsBodyHtml = true
                    };

                    message.To.Add(notification.Recepients);

                    smtpClient.Send(message);

                    notification.IsPending = false;

                    _emailNotificationRepository.Save(notification);
                }
            }
        }
        private void PostNotification(Crash crash)
        {
            var emailNotification = new EmailNotification
            {
                CreatedAt  = DateTime.Now,
                IsPending  = true,
                Message    = BuildMessageBody(crash),
                Subject    = $"[CrashReport] New crash",
                Recepients = _recepients
            };

            _emailNotificationRepository.Save(emailNotification);
        }