Twig Variable Rendering Failure in Custom Email Template (Xibo v4.3.1) - Data Rendering as ****

1. Context and Setup

  • CMS Version: Xibo CMS v4.3.1.
  • Installation: Docker environment (Linux).
  • Objective: To replace the default Display Offline email template with a fully customized HTML layout that correctly displays dynamic screen data (Name, IP, Time).

2. Current Status and Core Problem

A. What Works (Infrastructure Status) :white_check_mark:

  1. SMTP: Email sending via SMTP is functional.
  2. Layout/Theming: The custom HTML template is successfully loaded and rendered by the CMS. The structure and customized colors/logo are visible.
  3. Trigger: The alert system fires emails correctly based on the configured timeout.

B. The Core Problem (Data Failure) :cross_mark:

The custom template fails to receive the necessary data variables (Display Name, IP Address, Last Accessed Time) from the core PHP controller.

  • Symptom: Instead of the actual value (e.g., DP-AL1-GE-LCD1), the field renders the error placeholder **** (indicating a failure in accessing the object property).
  • Reason: The system is either failing to pass the complete Display object to the master template, or the exact property name required by this specific version is different from standard Twig notation.

3. Debugging and Actions Taken

We have completed the following troubleshooting steps:

  1. Structural Fix: Removed the problematic {% extends "email/base.twig" %} line and made the template self-contained, resolving the Twig\Error\LoaderError.
  2. Variable Attempts: Tested all common variable notations ({{ display.display }}, {{ display.clientAddress }}, {{ display['name'] }}, {{ name }}, etc.). All failed to resolve the data.
  3. File System: Confirmed that overwriting the master template (email-template.twig) works visually, but the data context is lost at that high level.
  4. Permissions & Cache: Ensured permissions are correct and cleared the cache repeatedly (rm -rf /var/www/cms/cache/*).

4. Request for Assistance and Code

We need confirmation on the exact variable syntax used in Xibo v4.3.1 for the Display Name and Client IP Address when the template is called as a structural master override.

What is the precise variable or array key that works in this context?

Code Currently in Use (Failing Data Retrieval)

<table class="alert-table">
    <tr>
        <td style="width: 35%; font-weight: bold; color: #555;">📺 Nome do Ecrã:</td>
        <td style="font-size: 16px; font-weight: bold; color: #000;">
            **{{ display.display }}** </td>
    </tr>
    <tr>
        <td style="font-weight: bold; color: #555;">🌐 Endereço IP:</td>
        <td style="font-family: monospace; font-size: 14px;">
            **{{ display.clientAddress }}**
        </td>
    </tr>
    <tr>
        <td style="font-weight: bold; color: #555;">🕒 Último Contacto:</td>
        <td>**{{ time }}**</td>
    </tr>
    </table>

Any ideas on how to solve this?