Magento 2: Cancel order email sent to customer if admin cancel order
-
15-04-2021 - |
Pergunta
I am very beginner to magento and i am looking for answer,
if i cancel order from admin panel but cancel email order is not sent to customer.
If i want to sent email to customer what should i need to do?
I already create custom email template for cancel order
I am using Ranosys module to cancel order from frontend.
Nenhuma solução correta
Outras dicas
create events.xml file at path companyname/modulename/etc/adminhtml/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="order_cancel_after">
<observer name="order_cancel" instance="companyname\modulename\Observer\ordercancel" />
</event>
</config>
Create observer file ordercancel.php at path
companyname\modulename\Observer
and insert the below code,
<?php
class ordercancel implements ObserverInterface
{
public function __construct(
) {
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
//implement here for sending mail
}
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange