Phplist Templates -

function plugin_customplaceholder($placeholder) { if ($placeholder == 'RANDOM_QUOTE') { return getRandomQuoteFromDb(); } return false; } Register it via $GLOBALS['plugins']['contentplaceholder'] = 'plugin_customplaceholder' .

: Most frustration stems from confusing the two. You modify admin UI via .tpl.php files. You modify email content via the database. 2. Anatomy of a Campaign Template (Deep Parsing) A PHPList email template is not just HTML. It is a PHP-evaluated string (if allow_php_templates is enabled) that undergoes three transformation passes. Pass 1: Global Placeholder Expansion The system scans for [GLOBAL:...] tags and replaces them with system data (list names, send date, system URLs). Pass 2: Personalization (Subscriber Data) Tags like [FIRSTNAME] , [EMAIL] , or [ATTRIBUTE:5] are replaced row-by-row during sending. This happens in PHPList’s mailqueue processing , not at template save time. Pass 3: Conditional Blocks (Proprietary DSL) PHPList supports a limited but powerful conditional syntax: phplist templates

: Version control (Git) does not capture template changes automatically. You must use the Export/Import feature (Admin > Templates > Export) or write SQL dumps: You modify email content via the database

function placeholder_EXTERNAL_TEMPLATE() { $ch = curl_init('https://your-cms.com/api/phplist-template'); return curl_exec($ch); } Then in template: [EXTERNAL_TEMPLATE] . Downside: one HTTP request per email send. Leave [CONTENT] empty and use a plugin to replace it with a fully rendered MJML→HTML string. This keeps templates static while allowing complex designs. Pattern C: Webhook-Driven Template Sync On Git push to a phplist-templates/ repo, trigger a script that updates the phplist_templatetemplate table via the PHPList API (or direct SQL). This gives you version control. Conclusion: The Quirky Genius of PHPList Templates PHPList’s templating system is not elegant, but it is deterministic, secure, and survivable . It has delivered billions of emails because its constraints (no filesystem reliance, simple conditionals, database storage) align perfectly with the hostile, low-resource environments of shared hosting. To master PHPList is to accept that templates are not code—they are parameterized messages with a very sharp knife . It is a PHP-evaluated string (if allow_php_templates is

Use the database as your source of truth. Never enable allow_php_templates . And always, always provide a text version. Your deliverability depends on it.