Пример #1
0
 private async Task SendWelcomeEmail(User user, string password)
 {
     var welcomeMessage        = string.Format(LocalizationManager.GetString(AbpModuleZeroConsts.LocalizationSourceName, "WelcomeMessage"), user.FullName);
     var yourUserIs            = string.Format(LocalizationManager.GetString(AbpModuleZeroConsts.LocalizationSourceName, "YourUserIs"), user.UserName);
     var yourDefaultPasswordIs = string.Format(LocalizationManager.GetString(AbpModuleZeroConsts.LocalizationSourceName, "YourDefaultPassword"), password);
     await _cinotamMailSender.DeliverMail(new EmailSendInput()
     {
         MailMessage = new MailMessage()
         {
             From    = new MailAddress((await SettingManager.GetSettingValueAsync("Abp.Net.Mail.DefaultFromAddress"))),
             To      = { new MailAddress(user.EmailAddress) },
             Subject = "Welcome to Cinotam.ModuleZero",
         },
         Body       = _templateManager.GetContent(TemplateType.Welcome, false, welcomeMessage, yourUserIs, yourDefaultPasswordIs),
         EncodeType = "text/html",
     });
 }
Пример #2
0
        public async Task <SendMessageResult> SendEmailMessage(IdentityMessage message)
        {
            var result = await _cinotamMailSender.DeliverMail(new EmailSendInput()
            {
                Body        = message.Body,
                MailMessage = new MailMessage()
                {
                    From    = new MailAddress((await SettingManager.GetSettingValueAsync("Abp.Net.Mail.DefaultFromAddress"))),
                    To      = { new MailAddress(message.Destination) },
                    Subject = "Cinotam- Two factor code",
                },
                EncodeType = "text/html",
            });

            return(new SendMessageResult()
            {
                SendStatus = result.MailSent ? SendStatus.Success : SendStatus.Fail
            });
        }