public void NotifyExceptionToDebugger(Exception exception, string classFunctionName = "")
        {
            try
            {
                string errorMsg = $"Exception Details={ExceptionUtils.FormatException(exception, includeContext: true)}";

                string sub = $"Exception position={classFunctionName}";
                _emailProvider.SendMail(_baseSettings.BugRecipientEmailAddress, sub, errorMsg);
            }
            catch (Exception ex)
            {
                _logger?.LogError(ex, "NotifyMaintenance met error ({0}) at Framework.ExceptionHandler.NotifyExceptionToDebugger ", ex.ReportAllProperties());
            }
        }
 public void Add(Comment comment)
 {
     _commentDal.Add(comment);
     try
     {
         _emailProvider.Subject   = "YKK Data Sheet Bildirimi Hk.";
         _emailProvider.toAddress = GetToAddress(comment);
         _emailProvider.Content   = GetContent(comment);
         _emailProvider.SendMail();
     }
     catch
     {
     }
 }
Exemple #3
0
        public void Add(UserPasswordChange instance, string email)
        {
            _changeDal.Add(instance);
            List <EmailAddress> toAddress = new List <EmailAddress>()
            {
                new EmailAddress {
                    Address = email
                },
            };

            _emailProvider.Subject   = "YKK Portal Şifre Değişikliği Hk";
            _emailProvider.toAddress = toAddress;
            _emailProvider.Content   = GetContent(instance);
            _emailProvider.SendMail();
        }
        public void SendMailUser(int Id)
        {
            var user = GetById(Id);

            List <EmailAddress> toAddress = new List <EmailAddress>()
            {
                new EmailAddress {
                    Address = user.Email
                },
            };

            _emailProvider.Subject   = "YKK Data Sheet Kullanıcı Bildirimi Hk.";
            _emailProvider.toAddress = toAddress;
            _emailProvider.Content   = GetContent(user);
            _emailProvider.SendMail();
        }
Exemple #5
0
        public void SendResetPasswordRequestEmail(ApplicationUser user, string url)
        {
            //Build the Email Message
            var message = new EmailMessage();

            message.To.Add(new EmailAddress {
                FirstName = user.FirstName, LastName = user.LastName, Address = user.Email
            });
            message.Substitutions.Add("-FirstName-", user.FirstName);
            message.Substitutions.Add("-LastName-", user.LastName);
            message.Substitutions.Add("-PasswordResetLink-", url);
            message.TemplateId = _sendGridSettings.PasswordReset;
            message.From       = new EmailAddress {
                Address = _smtpSettings.UserName, Name = _smtpSettings.FromName
            };
            message.Subject = "Password Reset";
            IEmailProvider emailProvider = _emailProviderFactoryHelper.GetEmailProvider(EmailProviderType.SendGrid);

            emailProvider.SendMail(message);
        }
Exemple #6
0
        public MessageResult SendQuestionnaireToClient(UserQuestionnaireModel questionnaire)
        {
            var    user = questionnaire.User;
            string from = _configurationProvider.ClientEmailFromAddress;
            string to   = questionnaire.IsFit2Work ?
                          questionnaire.Client.PrimaryEmailAddress :
                          questionnaire.Client.SecondaryEmailAddress;
            string subject = PopulatePlaceHoldersForQuestionnaire(
                questionnaire.IsFit2Work ?
                _resourceProvider.PrimaryEmailSubjectFormat :
                _resourceProvider.SecondaryEmailSubjectFormat,
                questionnaire);
            string body = PopulatePlaceHoldersForQuestionnaire(
                questionnaire.IsFit2Work ?
                _resourceProvider.PrimaryEmailBodyFormat :
                _resourceProvider.SecondaryEmailBodyFormat,
                questionnaire);
            var result = _emailProvider.SendMail(from, to, subject, body);

            result.MessageContent = body;
            return(result);
        }