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:
- Admin alerts.
- Client alerts.
- 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 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:
- \Tygh\Template\Mail\Template: This class functions as the model for email templates. It gives a programming-oriented representation of the structure of templates as they exist in the database.
- \Tygh\Template\Mail\Repository: Recognized as the repository class for templates, its core function is to deliver the nuts and bolts operations related to the templates. This encompasses tasks like fetching, adding, updating, and deleting templates directly from the database. Whenever the system requires these operations, it draws on the Tygh::$app['template.mail.repository'] container to instantiate this class.
- \Tygh\Template\Mail\Service: Elevated in its operation compared to the Repository class, the Service class is more sophisticated and offers high-level methods pertinent to the management of templates. When such intricate operations are demanded, the system leverages the Tygh::$app['template.mail.service'] container to bring this class into action.
- \Tygh\Template\Mail\Exim: Tailored for the specific purpose of handling the import and export functionalities of email templates, this class is essential for data portability regarding templates. To make use of its capabilities, Venddor IO accesses it through the Tygh::$app['template.mail.exim'] container.
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:
- Data Accumulation: Initiate by gathering the requisite data to craft the content of the message.
- 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);