issue with message template - OrderPaid.CustomerNotification

1 month ago
I created table to map between my order and payment result. if payment complete success, I mark order as paid  and redirect to checkout/complete else goto orders  history.
where is the issue? I think MarkOrderAsPaidAsync send customer notification
this is code
var order = _orderService.GetOrderByIdAsync(_transactionTrackerRecord.NopCommerce_OrderID).Result;
                    if (_transactionTrackerRecord.Sucess == true)
                    {

                        _orderProcessingService.MarkOrderAsPaidAsync(order);
                        return Redirect(_contextAccessor.HttpContext.Request.PathBase + "/checkout/completed/" + order.Id.ToString());
                    }

                    else
                    {
                        _orderProcessingService.CancelOrderAsync(order, true);

                        return Redirect(_contextAccessor.HttpContext.Request.PathBase + "/order/history/");
                    }
1 month ago
RE: calling Async methods:
                        _orderProcessingService.MarkOrderAsPaidAsync(order);
...
                        _orderProcessingService.CancelOrderAsync(order, true);

Should be using "await" - e.g.
  await _orderProcessingService.MarkOrderAsPaidAsync(order);

Although I don't think that would cause your issue of not getting CustomerNotification queued.  So, set a breakpoint and step through the code.
1 month ago
Thank you
after add backslash after url mails in message queue sent
and after add await before  _orderProcessingService.MarkOrderAsPaidAsync(order);
mail added into Message queue
but still OrderCompleted.CustomerNotification  after store owner change order status to completed
OrderPlaced.CustomerNotification -> added into Message queue and sent
and
OrderPaid.CustomerNotification -> added into Message queue and sent
but
OrderCompleted.CustomerNotification -> not
how can i fix it or if i must use another template and when this template "OrderCompleted.CustomerNotification"  fire?
1 month ago
Is the Order Status being set to Complete?
The "workflow" must be completed:  I.e., I believe that if shipping is required, you must have Shipments and Deliver them.
1 month ago
Ok i'll check cycle of shipping
But if i change status to completed from orders page why CustomerNotification not add to queue in case collect from store for example
1 month ago
Manually changing the status on the Edit Order Page does not go through workflow:
https://www.nopcommerce.com/en/boards/topic/97993/message-template-orderprocessingcustomernotification-email-not-triggered-when-changing-order-status-#308501