I am not being able to get the values from the purchase order to the order confirmation email.
If I run the template in the browser and pass the ordernumber through a querystring, it works. But in the email body, it gives me the "Error loading MacroEngine script"...
I know that the values are in querystring, because I made some experiences with the email, wich consisted in only getting the values from the querystring and printing them into the email body..
The lines that are comented, are the ones that I used to print only the values of the querystring to the email body, leaving the rest of the code comented...
As I said, this works in the browser, If I pass a orderNumber, through querystring, but not in the email body..
Email confirmation values
Hello guys,
I am not being able to get the values from the purchase order to the order confirmation email.
If I run the template in the browser and pass the ordernumber through a querystring, it works. But in the email body, it gives me the "Error loading MacroEngine script"...
I know that the values are in querystring, because I made some experiences with the email, wich consisted in only getting the values from the querystring and printing them into the email body..
Here's the code:
@{
var request = HttpContext.Current.Request;
//var orderGuid = umbraco.library.RequestQueryString("orderNumber");
//
@orderGuid.ToString()
var obj_basket = PurchaseOrder.SingleOrDefault(x => x.OrderNumber == umbraco.library.RequestQueryString("orderNumber"));
umbraco.cms.businesslogic.member.Member currentMember = umbraco.cms.businesslogic.member.Member.GetCurrentMember();
DateTime now = DateTime.Now;
var basketProperties = (from properties in obj_basket.OrderLines select properties).FirstOrDefault();
string str_productName = basketProperties.ProductName.ToString();
string str_userType = currentMember.getProperty("userType").Value.ToString();
string str_orderTotal = Convert.ToDecimal(obj_basket.OrderTotal).ToString("N2");
string str_orderId = obj_basket.OrderNumber.ToString();
string str_vatNumber = currentMember.getProperty("vatNumber").Value.ToString();
string str_firstName = obj_basket.BillingAddress.FirstName;
string str_lastName = obj_basket.BillingAddress.LastName;
string str_companyName = obj_basket.BillingAddress.CompanyName;
string str_vat = basketProperties.VAT.ToString();
string str_now = now.ToString("MMMM dd, yyyy");
}
The lines that are comented, are the ones that I used to print only the values of the querystring to the email body, leaving the rest of the code comented...
As I said, this works in the browser, If I pass a orderNumber, through querystring, but not in the email body..
Thank you in advance
Ok, I solved it...
It was the currentMember.getproperty lines the cause of the error.. I comented them and the email worked just fine
Ok,
Thanks for letting us know!
The content of the email is retrieved as a call
website => website
and not
customer => website
Kind regards,
Jesper
Thank you Jesper!
Made it work by getting the member through the email in the billing address..
Hi Gonçalo
Would you please mark this question as solved.
Thanks in advance.
Mads Due
is working on a reply...