cancel
Showing results for 
Search instead for 
Did you mean: 

Cancelled order message

Cancelled order message

I'm trying to find a way to (optionally) send a message to a customer when an order is cancelled, is there a good way of accomplishing that?

2 REPLIES 2

Re: Cancelled order message

You need to override Controller Cancel.php from below location

path /vendor/magento/module-sales/Controller/Adminhtml/Order/Cancel.php

 

you can change your message from above file.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Cancelled order message

Hello joseph_digiovanna

You can use order_cancel_after obsever event and send email to customer for order. it's dispatched in the cancel method of \Magento\Sales\Model\Order :

 

 

public function cancel()
{
    if ($this->canCancel()) {
        $this->getPayment()->cancel();
        $this->registerCancellation();

        $this->_eventManager->dispatch('order_cancel_after', ['order' => $this]);
    }

    return $this;
}


Hope it will help to solve problem then  Accept as Solution or Find helpful then Consider Giving Kudos to this post.