Try our conversational search powered by Generative AI!

TemplateService.Process giving Exception

Vote:
 

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

 

 

 

 

#81501
Feb 18, 2014 12:46
Vote:
 

Hi ,

 

Can anyone please guide us ? 

 

Regards,

Paragi

#81510
Feb 18, 2014 14:30
Vote:
 

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

#81598
Feb 20, 2014 11:47
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.