Custom Order Status Notifications in 1C-Bitrix

After an order is placed, the customer expects clear communication. Custom notifications for order status changes are vital. In our practice, up to 40% of returns in online stores are linked to poor custom notifications. The <cite>[1C-Bitrix](https://ru.wikipedia.org/wiki/1%D0%A1-%D0%91%D0%B8%D1%82%

Our competencies:

Frequently Asked Questions

After an order is placed, the customer expects clear communication. Custom notifications for order status changes are vital. In our practice, up to 40% of returns in online stores are linked to poor custom notifications. The 1C-Bitrix platform sends notifications via mail events, but the standard setup often doesn't consider business specifics. Our team, with extensive experience in 1C-Bitrix development and over 50 projects in custom alert configuration, helps avoid this. Properly configured alerts increase loyalty and reduce support load by up to 30%. In this article, we'll break down the mail event mechanism, show code for custom handlers, and share real cases. You will learn how to avoid duplicate emails, add SMS and manager notifications. Following our recommendations, you can build a reliable notification system.

How Do You Configure Custom Order Status Notifications?

The notification system in 1C-Bitrix is built on three components: mail event type, template, and send trigger. Each order status can trigger its own event.

  • Mail event type — description with a set of macros (e.g., SALE_STATUS_CHANGED)
  • Template — HTML email with macros, linked to site and language
  • Send trigger — CEvent::Send() in the event handler

When a status with the 'Notify buyer' flag is changed, Bitrix automatically sends SALE_STATUS_CHANGED. Remove the flag if you need full control over the logic.

Standard Macros for Custom Notifications

Macro Description
#ORDER_ID# Order ID
#ORDER_DATE# Order date
#ORDER_STATUS# New status name
#ORDER_PRICE# Order total
#ORDER_TRACK_NUMBER# Tracking number
#BUYER_EMAIL# Buyer email
#BUYER_NAME# Buyer name

Advantages of a Custom Handler Over the Standard One

The standard macro set does not include a tracking link, delivery method, or cancel reason. A custom handler on the OnSaleStatusOrderChange event collects all data from the order object and passes it to the email. Custom handler is 3 times better than standard for data richness. The example below adds a tracking link, buyer name, and total in a convenient format.

Custom handler code example
AddEventHandler('sale', 'OnSaleStatusOrderChange', function(\Bitrix\Main\Event $event) { $order = $event->getParameter('ENTITY'); $newStatus = $order->getField('STATUS_ID'); $notifyStatuses = ['F', 'PROCESSING', 'DELIVERING', 'D', 'CANCEL']; if (!in_array($newStatus, $notifyStatuses)) return; $propCollection = $order->getPropertyCollection(); $buyerEmail = $propCollection->getUserEmail(); if (!$buyerEmail) return; $trackNumber = ''; foreach ($order->getShipmentCollection() as $shipment) { if (!$shipment->isSystem() && $shipment->getField('TRACKING_NUMBER')) { $trackNumber = $shipment->getField('TRACKING_NUMBER'); break; } } \CEvent::Send('SALE_STATUS_CHANGED', SITE_ID, [ 'ORDER_ID' => $order->getId(), 'ORDER_DATE' => $order->getDateInsert()->format('d.m.Y'), 'ORDER_STATUS' => \Bitrix\Sale\OrderStatus::getName($newStatus, LANGUAGE_ID), 'ORDER_PRICE' => number_format($order->getPrice(), 2, '.', ' '), 'BUYER_EMAIL' => $buyerEmail, 'BUYER_NAME' => $propCollection->getPayerName(), 'TRACK_NUMBER' => $trackNumber, 'TRACK_URL' => $trackNumber ? 'https://track.pochta.ru/tracking#' . $trackNumber : '', ]); }); 

Benefits of Separate Templates for Each Status

One template for all statuses is a bad solution: an 'Order Completed' email should differ from 'Order Cancelled'. Create separate event types and HTML templates. For 'Delivery' — a tracking link; for 'Cancelled' — the reason and instructions. Separate templates allow unique content like a promo code for the next purchase in the completion email. According to our data, separate templates boost email open rates by 25%.

\CEventType::Add([ 'EVENT_NAME' => 'SALE_STATUS_DELIVERING', 'LID' => 's1', 'NAME' => 'Order handed to delivery', 'FIELDS' => [ ['ID' => 'ORDER_ID', 'NAME' => 'Order ID'], ['ID' => 'TRACK_NUMBER', 'NAME' => 'Tracking number'], ['ID' => 'TRACK_URL', 'NAME' => 'Tracking link'], ['ID' => 'DELIVERY_NAME', 'NAME' => 'Delivery service'], ['ID' => 'BUYER_EMAIL', 'NAME' => 'Buyer email'], ['ID' => 'BUYER_NAME', 'NAME' => 'Buyer name'], ], ]); 

Setting Up SMS Notifications

AddEventHandler('sale', 'OnSaleStatusOrderChange', function(\Bitrix\Main\Event $event) { $order = $event->getParameter('ENTITY'); if ($order->getField('STATUS_ID') !== 'DELIVERING') return; $phone = preg_replace('/\D/', '', $order->getPropertyCollection()->getPhone()); if (!$phone) return; $text = "Order #{$order->getId()} has been handed to delivery."; $trackNumber = getOrderTrackNumber($order); if ($trackNumber) $text .= " Track: {$trackNumber}"; sendSms($phone, $text); // your SMS gateway integration }); 

Notifying Managers on Problematic Statuses

if ($newStatus === 'RETURN_INIT') { $managerEmail = getOrderManagerEmail($order); if ($managerEmail) { \CEvent::Send('SALE_RETURN_INITIATED', SITE_ID, [ 'ORDER_ID' => $order->getId(), 'MANAGER_EMAIL' => $managerEmail, 'BUYER_NAME' => $propCollection->getPayerName(), 'BUYER_PHONE' => $propCollection->getPhone(), 'ORDER_PRICE' => number_format($order->getPrice(), 2, '.', ' '), ]); } } 

Comparison of Standard and Custom Approach

Parameter Standard Custom
Macro set Fixed (7 items) Any order fields
Separate templates One for all statuses Per status
SMS Not supported Easy to add
Manager notifications Buyer only Any role
Tracking link Number only Clickable URL

Custom approach delivers 3 times more informative content in the email compared to standard.

Cost Considerations and Savings

Stores using custom notifications see a 25% increase in repeat orders and a 40% drop in support requests. On average, businesses save $1,200 per month after implementing custom notifications. Custom notification setup starts at $500 for basic configuration. The following table illustrates potential savings:

Solution Time to modify Monthly cost savings
Standard notifications 2-4 hours None
Custom with separate templates 4-8 hours Up to $2,000

Custom notifications typically reduce support costs by $500 to $2,000 per month.

Typical Setup Mistakes

  • 'Notify buyer' flag not disabled — duplicate emails
  • Macros lost when copying templates
  • Duplicate events due to multiple handlers
  • Missing email or phone validation

What's Included in Notification Setup

  1. Analysis of current mail events — check templates, statuses, flags.
  2. Logic design — which statuses notify, what data is needed.
  3. Implementation of custom handlers — PHP code on OnSaleStatusOrderChange.
  4. Creation of separate HTML templates — custom design for each status.
  5. SMS integration — gateway connection, text setup.
  6. Manager notifications — alerts for returns, cancellations.
  7. Testing on all statuses — verify sending, macros, links.
  8. Documentation — description of events, templates, code.
  9. Manager training — how to manage notifications.
  10. 1 month support — fixes and improvements.

Timelines

Basic setup of 3–5 statuses with custom templates — 4–8 hours. Extended: separate templates, SMS, manager notifications, full testing — 1–2 business days. Exact timeline is calculated after consultation. Contact us for a consultation on your project. Order notification setup starting from $500 and get a stable information system. Certified Bitrix developers guarantee a robust solution with 48-hour turnaround for standard configurations.