How to setup magento admin to send email to customer when order is cancelled

How to setup magento admin to send email to customer when order is cancelled

August 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to setup magento admin to send email to customer when order is cancelled

Setting Up Magento Admin to Send Order Cancellation Emails

In Magento 1.5, sending automated emails when an order status changes requires some customization. In this guide, we’ll walk through the steps to configure your admin panel to send a cancellation email to customers.

Prerequisites

Before you begin, ensure that you have access to your Magento admin panel with sufficient permissions. Also, make sure your server is configured properly for sending emails.

Step 1: Create a New Email Template

  1. Log in to your Magento admin panel.
  2. Navigate to the “System” menu, then select “Transactional Emails.”
  3. Click on “Add New Template.”

Magento Transactional Emails

  1. Fill in the required details:

    • Template Name: Order Cancellation Notification
    • Template Code: order_cancellation_notification
    • Template Subject: [Your Store Name] - Your Order Has Been Cancelled
  2. In the “Template Content” section, you can use the available placeholders to dynamically insert order information.

Hi {{var customer_name}},

We regret to inform you that your order #{{var increment_id}} has been cancelled by our admin team.

Step 2: Configure the Email Template

  1. In the “Email Content” section, add your cancellation message and any other relevant details.

  2. Click on “Save Template.”

Step 3: Set Up the Event Observer

To trigger the email when an order status changes to ‘cancelled’, we need to create a new observer.

  1. Create a new directory named local in /app/code/core/Mage/Sales/Model/Order/ and inside that, a new file called Observer.php.

  2. Open Observer.php and add the following code:

class Mage_Sales_Model_Order_Observer
{
    public function orderStatusChanged($observer)
    {
        $event = $observer->getEvent();
        $order = $event->getOrder();

        if ($order->getStatus() == 'cancelled') {
            $templateId = 'order_cancellation_notification';
            $senderName = 'Your Store Name';
            $senderEmail = 'sales@yourstore.com';

            Mage::getModel('core/email_template')->sendTransactional(
                $templateId,
                $senderName,
                $senderEmail,
                $order->getCustomerEmail(),
                array('order' => $order),
                null
            );
        }
    }
}

Step 4: Set Up the Event Configuration

  1. Open /app/code/core/Mage/Sales/etc/config.xml and find the <events> section.

  2. Add the following observer configuration inside the <events> tag:

<event name="sales_order_status_change_after">
    <observer name="order_cancellation_email_observer" instance="Mage_Sales_Model_Order_Observer" />
</event>

Step 5: Test Your Setup

  1. From your Magento admin panel, navigate to the “Sales” menu and select “Orders.”

  2. Find an order you want to cancel and change its status to ‘cancelled’.

  3. After saving the changes, check your customer’s email for the cancellation notification.

Conclusion

By following these steps, you should now have successfully configured Magento 1.5 to send automated emails when an admin cancels a customer’s order.

Remember, if you’re facing any issues or need further assistance with your Magento setup, feel free to reach out to our team at Laravel Company. We offer expert Magento development and support services to help you make the most of this powerful e-commerce platform.

Magento 1 Security Extensions Themes

Our network