Customizing Email Alerts in Venddor IO

Introduction

In Venddor IO, it's simple to modify email alerts directly through the administrator dashboard. Navigate to Administration → Notifications to access and edit your desired email template. To streamline your choices, the email templates are categorized into distinct groups:

  1. Admin alerts.
  2. Client alerts.
  3. Supplier alerts (exclusive to the stores using Venddor Seller Center).

Venddor IO utilizes the Twig template engine, enabling developers to leverage its comprehensive features.

It's worth noting that Venddor IO also retains a legacy email dispatch mechanism rooted in Smarty templates. These templates are saved in TPL file format and cannot be altered via the admin interface. However, this older system is dormant by default as Venddor IO prioritizes the newer, more advanced notification mechanism.

Email Notification Templates in Venddor IO

The venddor_template_emails table holds the templates for email notifications within Venddor IO. Here's a breakdown of the structure of this table:

Email Templates Management Interface in Venddor IO

In Venddor IO, managing email templates is facilitated through a suite of specialized classes, each designed to handle specific aspects of email template operations. Here's a detailed explanation:

Email Notification Process in Venddor IO

Venddor IO's email notification system is efficient and multifaceted, designed to seamlessly handle email template operations. Here's a comprehensive breakdown:

  1. Data Accumulation: Initiate by gathering the requisite data to craft the content of the message.
  2. Sender Subsystem: Venddor IO has transitioned from the \Tygh\Mailer static class to the more dynamic \Tygh\Mailer\Mailer service class. Access it via the Tygh::$app['mailer'] container. When invoking a method to send the message, pinpoint the email template's character identifier with the 'template_code' key.

Example:

$mailer->send(array(
    'to' => 'company_orders_department',
    'from' => 'default_company_orders_department',
    'data' => array(...),
    'template_code' => 'call_requests_call_request',
    'tpl' => 'addons/call_requests/call_request.tpl',
    'company_id' => $company_id,
), 'A', $lang_code);