{# Variables - class - shortenLinkText - headItems - widget - bodyItems #} {% set class = class|default('table') %} {% set shortenLinkText = shortenLinkText|default(30) %} {% set showHeaders = [ 'mautic.dashboard.label.contact.email.address', 'mautic.dashboard.label.contact.open', 'mautic.dashboard.label.contact.click', 'mautic.dashboard.label.email.name', 'mautic.dashboard.label.segment.name', 'mautic.dashboard.label.company.name', 'mautic.dashboard.label.campaign.name', ] %} {% set showValues = [ 'contact_email', 'open', 'click', 'email_name', 'segment_name', 'company_name', 'campaign_name', ] %} {% if headItems is not empty %} {% for headItem in headItems %} {% if headItem in showHeaders %} {% endif %} {% endfor %} {% endif %} {% if bodyItems is not empty %} {% for id, row in bodyItems %} {% if row is iterable %} {% for key, item in row %} {% if key in showValues %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endif %}
{{ headItem|trans }}
{% if 'contact_email' == key and row.contact_id is not empty %} {{ item|slice(0, shortenLinkText) }} {% elseif 'email_name' == key and row.email_id is not empty %} {{ item|slice(0, shortenLinkText) }} {% elseif 'segment_name' == key and row.segment_id is not empty %} {{ item|slice(0, shortenLinkText) }} {% elseif 'company_name' == key and row.company_id is not empty %} {{ item|slice(0, shortenLinkText) }} {% elseif 'campaign_name' == key and row.campaign_id is not empty %} {{ item|slice(0, shortenLinkText) }} {% else %} {{ item }} {% endif %}