Page 1 of 1

Manual Email Invoice after Order

Posted: Thu Dec 11, 2008 4:13 pm
by TTMedia
Sometimes customers do not receive their email invoice, or the invoice after shipping.. and they want us to resend it to them,

Is there a way to send a customer an invoice of their order (if they didn't sign up as a user)?

Re: Manual Email Invoice after Order

Posted: Fri Dec 12, 2008 7:52 am
by mazhar
You can manually send the Email by loading the required data. For example if you want to send the Order Confirmation email again manually you can do this by something like as below

Code: Select all

EmailTemplate emailTemplate = EmailTemplateDataSource.LoadForCriteria("Name = 'Customer Order Notification' ");
        if(emailTemplate != null)
        {
            Order order = OrderDataSource.Load(orderId);
            if (order != null)
            {
                Hashtable parameters = new Hashtable();
                parameters.Add("store", Token.Instance.Store);
                parameters.Add("order", order);
                parameters.Add("payments", order.Payments);
                parameters.Add("customer", order.User);
                parameters.Add("user", order.User);
                emailTemplate.Parameters = parameters;
                emailTemplate.Send();
            }
        }
Where orderId is the id of order for which you want to send the alert.