November Happy Hour will be moved to Thursday December 5th.
Hi ,
I am using the Sample Site Code for the TemplateService Functionality .
I have set the path in Web.config and I am calling below method after the creation of the Order . I am facing the error Like Following
Error:
Method Code is as Following
private void SendEmails(PurchaseOrder order, string email) { // Add input parameter Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("OrderGroup", order);
// Send out emails // Create smtp client SmtpClient client = new SmtpClient();
MailMessage msg = new MailMessage(); msg.From = new MailAddress(_storeEmail, _storeTitle); msg.IsBodyHtml = true;
// Send confirmation email msg.Subject = String.Format("{1}: Order Confirmation for {0}", order.CustomerName, _storeTitle); msg.To.Add(new MailAddress(email, order.CustomerName)); msg.Body = TemplateService.Process("order-purchaseorder-confirm", Thread.CurrentThread.CurrentCulture, dic);
// send email client.Send(msg);
msg = new MailMessage(); msg.From = new MailAddress(_storeEmail, _storeTitle); msg.IsBodyHtml = true;
// Send notify email msg.Subject = String.Format("{1}: Order Notification {0}", order.TrackingNumber, _storeTitle); msg.To.Add(new MailAddress(_storeEmail, _storeTitle)); msg.Body = TemplateService.Process("order-purchaseorder-notify", Thread.CurrentThread.CurrentCulture, dic);
// send email client.Send(msg); }
Can anyone please guide me ? What i am missing ? What is the above error Indicating ?
Regards,
Paragi
Can anyone please guide us ?
Hi,
This was a bug (109154 - XslTemplateProvider fails as it cannot serialize a PurchaseOrder) and it was fixed in Commerce 7.5 Nuget update Release 2.
I suggest you to update to latest Nuget release to get this bug fixed.
Regards.
/Q
Hi ,
I am using the Sample Site Code for the TemplateService Functionality .
I have set the path in Web.config and I am calling below method after the creation of the Order . I am facing the error Like Following
Error:
Mediachase.MetaDataPlus.Configurator.MetaClass cannot be serialized because it does not have a parameterless constructor.
Method Code is as Following
private void SendEmails(PurchaseOrder order, string email)
{
// Add input parameter
Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add("OrderGroup", order);
// Send out emails
// Create smtp client
SmtpClient client = new SmtpClient();
MailMessage msg = new MailMessage();
msg.From = new MailAddress(_storeEmail, _storeTitle);
msg.IsBodyHtml = true;
// Send confirmation email
msg.Subject = String.Format("{1}: Order Confirmation for {0}", order.CustomerName, _storeTitle);
msg.To.Add(new MailAddress(email, order.CustomerName));
msg.Body = TemplateService.Process("order-purchaseorder-confirm", Thread.CurrentThread.CurrentCulture, dic);
// send email
client.Send(msg);
msg = new MailMessage();
msg.From = new MailAddress(_storeEmail, _storeTitle);
msg.IsBodyHtml = true;
// Send notify email
msg.Subject = String.Format("{1}: Order Notification {0}", order.TrackingNumber, _storeTitle);
msg.To.Add(new MailAddress(_storeEmail, _storeTitle));
msg.Body = TemplateService.Process("order-purchaseorder-notify", Thread.CurrentThread.CurrentCulture, dic);
// send email
client.Send(msg);
}
Can anyone please guide me ? What i am missing ? What is the above error Indicating ?
Regards,
Paragi