예제 #1
0
 public virtual MvcMailMessage VerifyEmail(EnquiryFormEntry enquiryFormEntry)
 {
     ViewBag.Name    = "Customer Name : " + enquiryFormEntry.Name;
     ViewBag.Message = "Message : " + enquiryFormEntry.Message;
     ViewBag.Email   = "Customer Email ID : " + enquiryFormEntry.Email;
     ViewBag.Phone   = "Customer Contact No. : " + enquiryFormEntry.PhoneNumber;
     return(Populate(x =>
     {
         x.ViewName = "VerifyEmail";
         x.Subject = "Customer Enquiry for Konquest Kreations";
         x.To.Add("*****@*****.**");
         x.CC.Add("*****@*****.**");
     }));
 }
 public ActionResult AddEnquiry(EnquiryFormEntry enquiryFormEntry)
 {
     if (ModelState.IsValid)
     {
         var enquiryForm = new EnquiryFormEntry();
         enquiryForm.Name        = HttpUtility.HtmlEncode(enquiryFormEntry.Name);
         enquiryForm.Email       = enquiryFormEntry.Email;
         enquiryForm.Message     = HttpUtility.HtmlEncode(enquiryFormEntry.Message);
         enquiryForm.PhoneNumber = enquiryFormEntry.PhoneNumber;
         db.EnquiryFormEntries.Add(enquiryForm);
         db.SaveChanges();
         var userMailer = new UserMailer();
         userMailer.VerifyEmail(enquiryForm).Send();
         return(RedirectToAction("Index"));
     }
     return(View("Index"));
 }