예제 #1
0
 public ReportServices(RealEstateDbContext dbContext, ApplicationUserManager userManager, WebPlatformServices webPlatformServices, NoReplyMailService noReplayMail, INotificationCreator notificationCreator)
 {
     _dbContext           = dbContext;
     _userManager         = userManager;
     _webPlatformServices = webPlatformServices;
     _noReplayMail        = noReplayMail;
     _notificationCreator = notificationCreator;
 }
예제 #2
0
        public static async Task RegiteredUserNotification(string userName, string userMail, string userPhoneNumber)
        {
            string titleTemplate = $"Клиент с потербителско име {userName} се регистрира!";
            string bodyTempalate = $"<h1 align=\"center\">Потребител беше регистриран на {DateTime.Now.ToString("dd.MM.yyyy HH:MM")} </h1> " +
                                   $"<div>Потребителско име:{userName}<div>" +
                                   $"<div>Email адрес: {userMail ?? "Не е зададен" }<div> " +
                                   $"<div>Телефонен номер:{userPhoneNumber ?? "Няма"}<div>";

            //Notification on company email
            await OfficeMailNotification(titleTemplate, bodyTempalate);

            string userMailTitle = "Регистрацията ви в \"sproperties.net\" е успешна!";
            string userMailBody  = $"Успешна регистрация<br> Може да влезете в системата от <a href=\"https://www.sproperties.net/Account/Login\">тук.</a>";

            await NoReplyMailService.SendHtmlEmailAsync(userMail, userMailTitle, userMailBody);
        }
예제 #3
0
 private static async Task OfficeMailNotification(string title, string body)
 {
     await NoReplyMailService.SendHtmlEmailAsync(ConfigurationManager.AppSettings["OfficeEmail"], title, body);
 }