November Happy Hour will be moved to Thursday December 5th.

Commerce for Software

Vote:
 

Hello

A customer will sale software,  and they want that Commerce will send a email with the download link after buying, Is this possible?

I just wonder if there is a build function to create this step.

Thanks

#116729
Feb 04, 2015 12:54
Vote:
 

Sorry, the vercion is commerce 7.5

#116730
Feb 04, 2015 12:55
Vote:
 

Hi,

Yes, definitely. If you look at the code of EPiServer Commerce Sample, you'll see we send an email to customer for order confirmation.

You can customize the template of email to include the download link.

Regards.

/Q

#116772
Feb 04, 2015 15:50
Vote:
 

Perfect! I will check it out...

Thanks Quan

#116791
Feb 04, 2015 20:46
Vote:
 

Hi Quan

Where exactly is this text in commerce sample site?

The confirmation email?

Juan 

#116825
Feb 05, 2015 13:17
Vote:
 

Hi,

It should be in CheckoutControl.cs

Here's the code:

        protected bool SendOrderNotificationAndConfirmation(PurchaseOrder order, string email)
        {
            try
            {
                // Add input parameter
                var dic = new Dictionary<string, object>()
                {
                    {"OrderGroup", order}
                };

                // Send out emails
                // Create smtp client
                var client = new SmtpClient();

                var msg = new MailMessage();
                msg.From = new MailAddress(_storeEmail, _storeTitle);
                msg.IsBodyHtml = true;

                // Send confirmation email
                msg.Subject = String.Format("{0}: Order Confirmation for {1}", _storeTitle, order.CustomerName);
                msg.To.Add(new MailAddress(email, order.CustomerName));
                msg.Body = TemplateService.Process("order-purchaseorder-confirm", Thread.CurrentThread.CurrentCulture, dic);

                // send email
                client.Send(msg);
                AddNoteToPurchaseOrder("Order notification send to {0}", order, email);
                order.AcceptChanges();
                return true;
            }
            catch (Exception ex)
            {
                LogManager.GetLogger(this.GetType()).Error(ex.Message, ex);
                return false;
            }
        }

Regards,

/Q

#116852
Feb 06, 2015 2:45
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.