Exemplo n.º 1
0
        public void RentalEmail(RentProperty RentalRequest)
        {
            string recipient = ConstantRepository.GetConstantByName("Rental_email_Recipient").Value1;

            string[] emailRecipient = recipient.Split(new string[] { "," }, StringSplitOptions.None);

            Mailer.RentalEmail(RentalRequest, emailRecipient).Send();
        }
Exemplo n.º 2
0
        public string SendRentalEmail(DateTime EventDate, string FullName, string PhoneNumber, string EmaiAddress, string BusinessName, string DescribeEvent)
        {
            try
            {
                RentProperty RentalRequest = new RentProperty();
                RentalRequest.EventDate     = EventDate;
                RentalRequest.FullName      = FullName;
                RentalRequest.PhnoeNumber   = PhoneNumber;
                RentalRequest.EmailAddress  = EmaiAddress;
                RentalRequest.BusinessName  = BusinessName;
                RentalRequest.DescribeEvent = DescribeEvent;

                EmailController EmailServer = new EmailController(ConstantRepository);
                EmailServer.RentalEmail(RentalRequest);
                return("Email sent successfully");
            }
            catch (Exception ex)
            {
                return("Error sending email");
            }
        }
Exemplo n.º 3
0
        public virtual MvcMailMessage RentalEmail(RentProperty model, string[] Recipients)
        {
            ViewBag.Subject      = "Church Property Rental Request";
            ViewBag.EventDate    = model.EventDate;
            ViewBag.FullName     = model.FullName;
            ViewBag.PhoneNumber  = model.PhnoeNumber;
            ViewBag.Email        = model.EmailAddress;
            ViewBag.BusinessName = model.BusinessName;
            ViewBag.Message      = model.DescribeEvent;

            return(Populate(x =>
            {
                x.Subject = "Church Property Rental Request";
                x.From = new System.Net.Mail.MailAddress(model.EmailAddress);
                foreach (string email in Recipients)
                {
                    x.To.Add(new System.Net.Mail.MailAddress(email));
                }
                x.ViewName = "RentalRequest";
                // x.Bcc.Add(model.MemberEmail);
                x.IsBodyHtml = true;
            }));
        }