Developer Forum »
Retrieving current order in confirmation mail
10 posts

Hi

If I set a confirmation mail based on a template in webshop settings, how do I get the current order when I want to populate it.

 

Usualy I get the current order with the following snippet

Order o = WAFShopHelper.GetCurrentOrder(Request, Response);

However this returns null when the code reach the state of sending a confirmation mail

 

Thx in advance

 

Christoffer

181 posts

Hei!

 

In the confirmation email template, the order is available through WAFContext.Request.GetContent<Order>(). 

You can't use WAFShopHelpers for emails because it only returns Orders in basket status. The solution used means that the email generation can be done at any time for any order, so it's much more flexible.

 

Vidar

10 posts

Lovely thank you

1