Developing 1C-Bitrix email templates

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Email Template Development for 1C-Bitrix

The emails Bitrix sends — order confirmation, password reset, new lead notification — look like a text block on a white background with a logo by default. The logo is blurry, the font is system-default, and the site link is blue and underlined. If a company invests in marketing and design but then sends customers an email like this, that is a communication breakdown.

Email Template Development for 1C-Bitrix

How Email Templates Work in Bitrix

Email templates in Bitrix are stored in the main module and edited in the admin panel under Settings → Mail → Mail Templates. Each template is linked to a mail event (for example, SALE_NEW_ORDER — new order, MAIN_USER_PASS_CHANGED — password change).

An email template consists of:

  • FROM, TO, CC, BCC, SUBJECT fields — can contain macros (#SITE_NAME#, #ORDER_ID#)
  • Email body — HTML with macro support

HTML in email clients renders differently from HTML in a browser: external CSS files, <link>, CSS Grid, Flexbox (partially), and most pseudo-elements are not supported. Everything must use inline styles and table-based layout.

Technical Requirements for HTML Emails

  • Inline CSS — all styles are applied via the style="" attribute. External stylesheets and <style> blocks are ignored by Gmail, Outlook, and other clients (or handled unpredictably)
  • Table-based structure<table> for layout. <div> with display: flex does not work in Outlook
  • Fixed pixel values — not rem, not % for block widths, only px
  • Email width — wrapper maximum 600–640px
  • Alt text — images are blocked by default in Outlook, Gmail, and Yandex Mail. A text alternative is mandatory
  • Encoding — UTF-8, specified in the meta tag and the email header

Working with Bitrix Macros

The template body has access to event macros — for example, for SALE_NEW_ORDER: #ORDER_ID#, #ORDER_DATE#, #PRICE#, #DELIVERY_NAME#, #USER_EMAIL#, #ITEMS#, and others. The full list of macros is visible in the template editor form.

Some macros return ready-made HTML (for example, the order items table in #ITEMS#). These blocks are harder to customize — their content is generated by the sale module, and changing the markup is only possible via event handlers in a custom module.

For full control over order item markup, use the OnSaleOrderSaved event handler and generate the HTML manually.

Responsive Design in Emails

Not all email clients support responsive emails, but basic responsiveness for mobile devices works via @media in a <style> block (Outlook ignores it, but iOS Mail and Gmail on Android support it). Pattern: 600px table on desktop, width: 100% !important on mobile.

Case Study: Order Confirmation Email

An online store on Bitrix "Small Business". The standard order email — a table on a white background with no branding. Task: an email in the company's visual identity, with a logo, banner, items table, delivery block, and a "Track Order" CTA button.

We developed an HTML template with inline styles. The items table was overridden via an event handler (a custom module, OnSaleNewOrderNewAdminSend method). The result was tested in Litmus: correct rendering in Gmail, Outlook 2016/2019, Yandex Mail, Apple Mail, and Samsung Mail. The work took 2 days including testing.

Timeline

Scope Timeline
1–3 simple templates (notifications, no custom macros) 1–2 days
A set of 5–10 templates with a unified design 3–7 days
Templates with macro overrides via a module from 1 week