Posted on 29/03/2022 12:07:52
Thanks Dmitriy,
I ended up doing a scheduled task. Orderstate will get changed during execution and order.save() will trigger mail sending but mails are not sesnd due to an exception:
Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object. at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Boolean isRecursiveCall, Lazy`1 categoryFieldSorting, Int32 orderLineOfProductCount, RenderingContext renderingContext, String unitId) at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderLine(OrderLine orderLine, Template template, RenderingContext renderingContext) at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderLines(OrderLineCollection orderLines, Template parentTemplate, String loopName, RenderingContext renderingContext) at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderDetails(Template template, Order order, Boolean extendedProperties, OrderTemplateExtenderContext orderContext) at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrder(Order order, Template template, Boolean extendedProperties, Int32 stepNumber, OrderTemplateExtenderContext orderContext) at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrder(Order order, Template template, Boolean extendedProperties, OrderTemplateExtenderContext orderContext) at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrder(Order order, Template template) at Dynamicweb.Ecommerce.Orders.OrderService.SendEmail(Order order, PageView& pageView, String subject, IEnumerable`1 toMailAddresses, String fromMailAddress, String fromMailName, Template& mailTemplate) at Dynamicweb.Ecommerce.Orders.OrderService.SendEmail(Order order, PageView& pageView, String subject, String toMailAddress, String fromMailAddress, String fromMailName, Template& mailTemplate) at Dynamicweb.Ecommerce.Orders.OrderService.SendStateChangedEmail(Order order, OrderState state, PageView pageView) at Dynamicweb.Ecommerce.Orders.OrderService.NotifyOrderStateChanged(Order order) at Dynamicweb.Ecommerce.Orders.OrderService.Save(Order order, Boolean saveOldVersion) at Dynamicweb.Ecommerce.Orders.OrderService.Save(Order order) at PlusPlus.Core.ScheduledTasks.SetOrderStateShipped.Run()
Any ideas? it's a DW 9.13.3
Best regards Søren