public StandardEmailTemplate CreateForgottenPasswordEmailTemplate(string resetURL, string toEmailAddress, string passwordlink)
        {
            StandardEmailTemplate email = new StandardEmailTemplate(toEmailAddress);

            email.theAsposeMessage.Subject  = "Portugal Rental Cottages: Password Reset - Please read";
            email.theAsposeMessage.HtmlBody = "<h2>Thank you for using Portugal Rental Cottages. You have requested a password reset, please click the link below to resent your password</h2>";
            email.theAsposeMessage.HtmlBody = "<a href=\"" + resetURL + "?token=" + passwordlink + "\">Click here to reset your password</a>";

            return(email);
        }
        public int SendEmailToCustomer(Customer customer, int EmailTemplateID, Booking booking = null, BookingExtraSelection bes = null)
        {
            try
            {
                StandardEmailTemplate template = new StandardEmailTemplate(customer.EmailAddress, EmailTemplateID, customer, booking, bes);
                template.SendEmail();

                return(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public override EventCommandResult ExecuteCommand()
        {
            var result = new EventCommandResult();

            var template = new StandardEmailTemplate(customer.EmailAddress, this.EmailTemplateId, customer, booking, bes);


            if (this.Event.Documents.Equals(null))
            {
                this.Event.Documents = new Collection <Document>();
                this.Event.Documents.Add(new Document());
            }

            if (this.Event.Documents.Count > 0)
            {
                foreach (var doc in this.Event.Documents)
                {
                    Stream docStream = new MemoryStream(doc.DocumentBLOB);
                    template.theAsposeMessage.AddAttachment(new Attachment(docStream, doc.DocumentName + ".pdf"));
                }
            }

            if (template.SendEmail())
            {
                result.ResultCode          = 200;
                result.CommandExecutedInfo = "EmailOutCommand";
                result.ResultMessage       = "OK";
            }
            else
            {
                result.ResultCode          = 800;
                result.CommandExecutedInfo = "EmailOutCommand";
                result.ResultMessage       = "Fail";
            }

            return(result);
        }