private static void SendNewSPRDUserNotificationEmail(User user) { Email emailByID = EmailService.GetEmailByID("SPRDNEWUSERNOTIFICATION"); emailByID.AccountIDs = user.UserID; emailByID.Body = emailByID.Body.Replace("#FULLNAME_TAG#", user.FullName); emailByID.Body = emailByID.Body.Replace("#ROLE_TAG#", user.Role.ToString()); emailByID.Body = emailByID.Body.Replace("#SYSTEM_URL#", "https://lhd.spreadtrum.com"); emailByID.EmailID = Guid.NewGuid().ToString(); emailByID.NextTryTime = DateTime.Now.AddSeconds(30.0); emailByID.Recipients = "*****@*****.**"; EmailService.AddEmail(emailByID); }
public ActionResult Create(EmailModel model) { if (ModelState.IsValid) { try { emailService.AddEmail(model.ContactId, model.ToEntity()); return(RedirectToAction("Index", new { id = model.ContactId })); } catch (Exception ex) { ViewBag.ErrorMessage = ex.Message; return(View(model)); } } return(View(model)); }
public ActionResult SendEmail(Email emailModel) { if (ModelState.IsValid) { _emailService.AddEmail(emailModel); bool result = SendingEmail.SendEmail(emailModel); if (result) { ViewBag.Message = "Your message has been sent successfully!"; } else { ViewBag.Message = "Error sending message :("; } return(View("SendEmail")); } return(View("Contact", emailModel)); }