i'm trying to access the order/customer info from the email template so i can have a summary of what's been ordered included in the email, and the email can be personalised. pretty standard stuff i would think.but there are no examples on the net that i can find.
i'm seeing the order guid in the Request object querystring but finding order guid in the DB is proving difficult. where is it? how can i use the guid to retrieve the order details?
The easiest way to send an order confirmation is to use the SendEmail task in the checkout pipeline (preconfigured when you install uCommerce). It will look for an e-mail type called OrderConfirmation.
In the template you set up for OrderConfirmation you can use GetPurchaseOrder:
CommerceLibrary:GetPurchaseOrder($orderGuid)
to load the order information.
The reason you have to use this one instead of GetBasket() is that the basket is gone once Checkout is called beucase it's converted to a new order.
if anyones interested in how i did this in a bit more detail. maybe it's wrong, but i works.
here's some of the code behind of my email template where i grab the order guid from the query string that gets sent by default from SubmitBasket.xslt.
publicpartialclassEmail : System.Web.UI.MasterPage
{
protectedvoid Page_Load(object sender, EventArgs e)
{
var custname = Request.QueryString["orderNumber"].ToString();
Guid orderGuid = newGuid("3d8c28dc-2ca2-41d6-a5da-40843e980bee");
var orderObj = UCommerce.EntitiesV2.PurchaseOrder.Find(x => x.OrderGuid == orderGuid);
var peep = orderObj.Select(x => x.Customer);
var fname = peep.FirstOrDefault().FirstName;
litName.Text = fname.ToString();
}
}
There's no right and wrong. Just getting the job done :) In fact this is the way we originally did it in the store, but the behavior was changed to avoid some page requests in the checkout flow and duplicate e-mails being sent if the order confirmation page is displayed multiple times.
The pipeline ensures that the confirmation is only sent once as it's executed only when the order is placed.
send email when ordering
i'm trying to access the order/customer info from the email template so i can have a summary of what's been ordered included in the email, and the email can be personalised. pretty standard stuff i would think.but there are no examples on the net that i can find.
i'm seeing the order guid in the Request object querystring but finding order guid in the DB is proving difficult. where is it? how can i use the guid to retrieve the order details?
i've read this http://www.publicvoid.dk/SendingEmailUsingUCommerce.aspx but i can't workout from that post how to pass the customerid thru in the query string ffrom my submitbasket.xslt.
here's my xslt
The easiest way to send an order confirmation is to use the SendEmail task in the checkout pipeline (preconfigured when you install uCommerce). It will look for an e-mail type called OrderConfirmation.
In the template you set up for OrderConfirmation you can use GetPurchaseOrder:
to load the order information.
The reason you have to use this one instead of GetBasket() is that the basket is gone once Checkout is called beucase it's converted to a new order.
Hope this helps.
if anyones interested in how i did this in a bit more detail. maybe it's wrong, but i works.
here's some of the code behind of my email template where i grab the order guid from the query string that gets sent by default from SubmitBasket.xslt.
here's the xslt. i commented out the send email task in the checkout pipline config and send the email from the xslt. hope this helps someone
There's no right and wrong. Just getting the job done :) In fact this is the way we originally did it in the store, but the behavior was changed to avoid some page requests in the checkout flow and duplicate e-mails being sent if the order confirmation page is displayed multiple times.
The pipeline ensures that the confirmation is only sent once as it's executed only when the order is placed.
is working on a reply...