Developer forum
E-mail notifications
Order status email generation failed when status change from code
Replies
Something on a product on an orderline seems to be having a missing value - or a missing renderingContext (are you changing the state in code that is not httpContext?)
You need to add a debugger and add debugging symbols for Dynamicweb.Ecommerce so we can get a line number where the exception happens.
Also can you provide the DW version?
BR Nicolai
its latest DW 9.15.13
issue comes from OrderLines loop
foreach (LoopItem orderline in GetLoop("OrderLines"))
Hi Shiwanka
I need a bit more info to understand. Where do you change the orderstate from? And in what context is it executed - schedule, pageview or something else?
Order state change from webapi controller and that uses dwapi APIRegistrationBase
used OrderService to save the order
any update?
I'm having the same issue as the OP.
If I change the order state via the Admin portal, the email gets sent without issue, but when i change the state via code it gives error in Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct as per original post.
Maybe there is a special way to create the order object that pulls in a more complete object than using the Ecommerce.Services.Orders.GetById() - maybe something is not populated by this method.
DW v 9.15.13
It looks like Dynamicweb.Admin is doing the exact same thing but it works in there, just not when using a scheduled task.
Dynamicweb.Ecommerce.Services.Orders.GetById();
Dynamicweb.Ecommerce.Services.Orders.Save();
Using the Designs/Rapido/eCom7/CartV2/Mail/Order.cshtml template.
Just can't see why there would be a difference between the Admin code and using the exact same code in a library.
Hi Andrew
can you try latest 9.15.17
as i remember this was already fixed
I upgraded to 9.15.17 and still getting issue.
If you change the status in the Admin, it works, but not when running same process via code.
You must be logged in to post in the forum