BX Mailtext
Overview
BX Mailtext is an admin module for modified eCommerce to centrally manage email templates.
It edits plain text and HTML templates file-based inside the active shop template and uses dedicated database tables for template metadata, placeholders, and whitelist entries.
Core components:
- Admin controller with action routing (
admin/bx_mailtext.php) - Service/helper functions (
admin/includes/extra/functions/bx_mailtext.php) - System module for install/update/remove (
admin/includes/modules/system/bx_mailtext.php)
Current Feature Set
- Template editor for frontend/backend mails (TXT + HTML)
- Language switch for editing
- Test mail sending (TXT/HTML)
- Placeholder panel with drag and drop into textarea/CKEditor
- Backup management (create, restore, delete)
- Audit (database vs filesystem) including CSV export
- Action to create missing database entries from existing template files
- Action to sync missing placeholders from template files into the database
- Demodata management per template
- AJAX modal for demodata (create/edit/delete)
- Auto generation of missing demodata on new database entries
Installation and Configuration
System module file:
admin/includes/modules/system/bx_mailtext.php
The install process automatically:
- Creates/sets admin permission
admin_access.bx_mailtext - Creates a configuration group
- Creates configuration keys
- Creates the module tables
- Seeds default mail types, placeholders, and whitelist records
Relevant configuration keys:
MODULE_BX_MAILTEXT_STATUSMODULE_BX_MAILTEXT_VERSIONMODULE_BX_MAILTEXT_CONFIG_ID
Module version (from code): 2.0.0
Database Tables
Table constants in includes/extra/database_tables/bx_mailtext.php:
TABLE_BX_MAILTEXT_MAILS=>mailtext_mailsTABLE_BX_MAILTEXT_PLACEHOLDERS=>mailtext_placeholdersTABLE_BX_MAILTEXT_WHITELIST=>mailtext_whitelist
Purpose:
mailtext_mails: mail types includingmailid,systemposition, and display namemailtext_placeholders: placeholders per template (FK tomailtext_mails)mailtext_whitelist: script/path whitelist for mail mapping
File Structure
Routing, Bootstrap, and Integrations
admin/includes/extra/filenames/bx_mailtext.phpadmin/includes/extra/menu/bx_mailtext.phpincludes/extra/database_tables/bx_mailtext.phpincludes/extra/wysiwyg/bx_mailtext.php
Module Logic and UI
admin/bx_mailtext.phpadmin/includes/extra/functions/bx_mailtext.phpadmin/includes/extra/javascript/bx_mailtext.phpadmin/includes/extra/css/bx_mailtext.phpadmin/includes/modules/bx_mailtext/list.phpadmin/includes/modules/bx_mailtext/editor.phpadmin/includes/modules/bx_mailtext/backups.phpadmin/includes/modules/bx_mailtext/audit.phpadmin/includes/modules/bx_mailtext/demodata/admin/includes/modules/bx_mailtext/backups/
Language Files
lang/german/modules/system/bx_mailtext.phplang/german/extra/admin/bx_mailtext.phplang/english/modules/system/bx_mailtext.phplang/english/extra/admin/bx_mailtext.php
Admin Assets
admin/images/icons/heading/bx_mailtext.pngadmin/images/supermailer/mailtext.jpg
Relevant Controller Actions
Key actions in admin/bx_mailtext.php:
mv_mailtext_auditmv_mailtext_audit_export_csvmv_mailtext_create_db_entrymv_mailtext_sync_placeholdersmv_mailtext_backup_listmv_mailtext_build_backupmv_mailtext_restore_backupmv_mailtext_delete_backupmv_change_languagemv_demodata_modal(HTML response)mv_demodata_save(JSON response)mv_demodata_delete(JSON response)send_test_mailmv_update
Template Paths
Storage paths by language and position:
- Frontend:
templates//mail/ / - Backend:
templates//admin/mail/ /
File pair per mail ID:
.txt .html
Note: Missing files are created automatically during loading (including directory creation).
Audit and Consistency Check
The audit evaluates:
- Database entries with missing template files
- Files without a database entry (orphans)
- Complete templates without matching placeholder entries
Additional functions:
- Summary metrics
- CSV export (
mailtemplate_audit_YYYYMMDD_HHMMSS.csv) - Create database entry from file findings
- Synchronize placeholders from files into the database
Placeholders and Demodata
Recognized placeholder formats:
- Smarty:
{$variable}and{$object.property} - Token:
[SIGNATUR]
Demodata files:
- Location:
admin/includes/modules/bx_mailtext/demodata/ - Naming convention:
mv_demodata__ .php
Behavior:
- Missing demodata can be generated automatically for new database entries
- Demodata can be edited/saved/deleted in an admin modal
- Test mail rendering uses demodata files for placeholder values
Operations and Maintenance Notes
- The module is legacy-compatible and uses
xtc_db_*and direct SQL. - Write permissions are required.
- Affected paths:
templates//... - Affected paths:
admin/includes/modules/bx_mailtext/backups/ - Affected paths:
admin/includes/modules/bx_mailtext/demodata/ - The module CSS includes Font Awesome via CDN (
cdnjs.cloudflare.com). - After adding new templates, an audit run is recommended to keep DB/files/placeholders consistent.
Summary
BX Mailtext 2.0.0 provides a complete admin workflow for email templates in modified: editing, test sending, placeholder management, backups, audit, and demodata management in one module.
