Exemplo n.º 1
0
        private void EmailReceipt()
        {
            try
            {
                if (buyer.Count == 1)
                {
                    if (!String.IsNullOrEmpty(buyer[0].Person.email))
                    {
                        ((App)App.Current).GetWorkOrderPayment(workOrderId).ContinueWith(a => WorkOrderPaymentLoaded(a.Result));
                    }
                    else //let EO know the customer needs to add an email address
                    {
                        EmailHelpers emailHelper = new EmailHelpers();

                        EOMailMessage mailMessage = new EOMailMessage();

                        string emailHtml = emailHelper.ComposeMissingEmail(buyer[0]);

                        mailMessage = new EOMailMessage("*****@*****.**", "*****@*****.**", "Missing Customer Email", emailHtml, "Orchids@5185");

                        Email.SendEmail(mailMessage);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        //https://emailmg.dotster.com/roundcube/?_task=login
        //[email protected]
        //Orchids@5185

        public static bool SendEmail(EOMailMessage msg)
        {
            bool success = false;

            SmtpClient smtp = new SmtpClient();

            smtp.Port                  = 587;
            smtp.Host                  = "smtp.dotster.com"; //"smtp.gmail.com"; //for gmail host
            smtp.EnableSsl             = true;
            smtp.UseDefaultCredentials = false;
            smtp.Credentials           = new NetworkCredential(msg.MailMessage.From.Address, msg.Pwd);
            smtp.DeliveryMethod        = SmtpDeliveryMethod.Network;

            try
            {
                smtp.Send(msg.MailMessage);
                success = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(success);
        }
Exemplo n.º 3
0
        public void Send_Click(object sender, RoutedEventArgs e)
        {
            if (bugs.Text.Length > 0)
            {
                Window wnd = Application.Current.MainWindow;

                EOMailMessage msg = new EOMailMessage();
                try
                {
                    msg = new EOMailMessage("*****@*****.**", "*****@*****.**", "Admin Bug or Feature Request", bugs.Text, ((App)App.Current).Dootster);
                    if (Email.SendEmail(msg))
                    {
                        bugs.Text = String.Empty;
                        MessageBox.Show(wnd, "Your message has been set to the development team", "Success", MessageBoxButton.OK);
                    }
                    else
                    {
                        MessageBox.Show(wnd, "There was an error sending your message - call Vince!", "Error", MessageBoxButton.OK);
                    }
                }
                catch (Exception ex)
                {
                    Exception ex2 = new Exception("EO Admin Bugs Send Email", ex);
                    ((App)App.Current).LogError(ex2.Message, JsonConvert.SerializeObject(msg));
                }
            }
        }
Exemplo n.º 4
0
        private async void EmailReceipt(WorkOrderPaymentDTO workOrderPayment)
        {
            try
            {
                if (Customer.Person.person_id > 0)
                {
                    EmailHelpers emailHelper = new EmailHelpers();

                    EOMailMessage mailMessage = new EOMailMessage();

                    string emailHtml = String.Empty;

                    if (!String.IsNullOrEmpty(Customer.Person.email))
                    {
                        GenericGetRequest         request         = new GenericGetRequest("GetWorkOrderPrices", "workOrderId", workOrderPayment.WorkOrderId);
                        GetWorkOrderPriceResponse workOrderPrices = await((App)App.Current).GetRequest <GetWorkOrderPriceResponse>(request);

                        emailHtml = emailHelper.ComposeReceipt(currentWorkOrder, workOrderPayment, workOrderPrices);

                        mailMessage = new EOMailMessage("*****@*****.**", Customer.Person.email, "Elegant Orchids Receipt", emailHtml, "Orchids@5185");
                    }
                    else //let EO know the customer needs to add an email address
                    {
                        emailHtml = emailHelper.ComposeMissingEmail(Customer);

                        mailMessage = new EOMailMessage("*****@*****.**", "*****@*****.**", "Missing Customer Email", emailHtml, "Orchids@5185");
                    }

                    Email.SendEmail(mailMessage);
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 5
0
        private void WorkOrderPricesLoaded(WorkOrderResponse workOrder, WorkOrderPaymentDTO payment, GetWorkOrderPriceResponse workOrderPriceResponse)
        {
            EmailHelpers emailHelper = new EmailHelpers();

            EOMailMessage mailMessage = new EOMailMessage();

            string emailHtml = emailHelper.ComposeReceipt(workOrder, payment, workOrderPriceResponse);

            mailMessage = new EOMailMessage("*****@*****.**", buyer[0].Person.email, "Elegant Orchids Receipt", emailHtml, "Orchids@5185");

            Email.SendEmail(mailMessage);
        }
Exemplo n.º 6
0
        private void SendInfoEmail(string emailHtml)
        {
            try
            {
                EOMailMessage mailMessage = new EOMailMessage("*****@*****.**", "*****@*****.**", "Missing Image", emailHtml, "Orchids@5185");

                Email.SendEmail(mailMessage);
            }
            catch (Exception ex)
            {
                Exception ex2 = new Exception("SendInfoEmail", ex);
                LogError(ex2.Message, "emailHtml = " + emailHtml);
            }
        }
Exemplo n.º 7
0
        private void sendBugReport_Clicked(object sender, EventArgs e)
        {
            if (bugReport.Text.Length > 0)
            {
                string msg = ((App)App.Current).User + "says: " + bugReport.Text;

                EOMailMessage mailMessage = new EOMailMessage("*****@*****.**", "*****@*****.**", "User Report", msg, "Orchids@5185");

                if (mailMessage.MailMessage != null)
                {
                    Email.SendEmail(mailMessage);

                    DisplayAlert("Email Report", "Your message has been set to the development team", "OK");
                }

                bugReport.Text = String.Empty;
            }
        }