{% macro renderAvailableVariablesWidget(entityName, entityChoiceFieldId) %}
{% endmacro %} {% macro renderPreviewDialog(formName, title) %} {% endmacro %} {# Remders email address owner name as text Parameters: emailAddress - email address entity Oro\Bundle\EmailBundle\Entity\EmailAddress #} {% macro email_address_text(emailAddress) -%} {{ emailAddress.owner|oro_format_name|default('N/A')|escape }} {%- endmacro -%} {# Remders email address owner name as link based on owner type Parameters: emailAddress - email address entity Oro\Bundle\EmailBundle\Entity\EmailAddress #} {% macro email_address_link(emailAddress, label) -%} {% set label = label|default(_self.email_address_text(emailAddress)) %} {#- TODO: we need EntityConfig to get view url for an entity -#} {{ _self.email_address_text(emailAddress) }} {%- endmacro -%} {# Render email address name, owner name or a link to owner view page can be rendered depends on given parameters Parameters: emailAddress - email address entity Oro\Bundle\EmailBundle\Entity\EmailAddress emailAddressName - a string contains an email address. It is used if the email address has no owner noLink - determines whether the rendering of a link to the owner view page is forbidden or not. Default value is false knownOnly - if true renders only emails which have an owner; otherwise, all emails. Default value is false #} {% macro email_address(emailAddress, emailAddressName, noLink, knownOnly) -%} {% if emailAddress.owner is null -%} {% if not knownOnly|default(false) -%} {{ emailAddressName }} {%- endif %} {%- else -%} {% if noLink|default(false) -%} {{ _self.email_address_text(emailAddress) }} {%- else -%} {{ _self.email_address_link(emailAddress)|raw }} {%- endif %} {%- endif %} {%- endmacro %} {# Render email address with title Parameters: email - EmailInterface object or string title (optional) - email title #} {%- macro email_address_simple(email, title) -%} {% if email is not empty %} {% set emailAddress = null %} {# if email is an object implemented EmailInterface #} {% if email.email is defined %} {% if email.email is not empty %} {% set emailAddress = email.email %} {% endif %} {# if email is a string #} {% else %} {% set emailAddress = email %} {% endif %} {% if title is empty %} {% set title = emailAddress %} {% endif %} {% if emailAddress %} {{ title }} {% endif %} {% endif %} {%- endmacro -%} {# Render the given email recipients Parameters: recipients - an array of Oro\Bundle\EmailBundle\Entity\EmailRecipients noLink - determines whether the rendering of a link to the owner view page is forbidden or not. Default value is false knownOnly - if true renders only emails which have an owner; otherwise, all emails. Default value is false #} {% macro recipient_email_addresses(recipients, noLink, knownOnly) -%} {% set addresses = {} -%} {% for recipient in recipients -%} {% set address = _self.email_address(recipient.emailAddress, recipient.name, noLink, knownOnly) %} {%- if address|length > 0 -%} {% set addresses = addresses|merge([address]) %} {% else %} {% set addresses = addresses|merge([recipient.emailAddress.email]) %} {%- endif %} {%- endfor -%} {% for address in addresses -%} {{ address }} {%- if not loop.last %}; {% endif %} {% else %} {{ 'N/A'|trans }} {%- endfor %} {%- endmacro %} {# Render the given email attachments Parameters: attachments - an array of Oro\Bundle\EmailBundle\Entity\EmailAttachment #} {% macro attachments(attachments) -%} {%- for attachment in attachments -%} {{ attachment.fileName }} {%- endfor -%} {%- endmacro %} {# Render email body Parameters: emailBody - email body entity Oro\Bundle\EmailBundle\Entity\EmailBody cssClass - used to specify an additional CSS class for email body container HTML element #} {% macro body(emailBody, cssClass) -%} {% if emailBody.bodyIsText -%}{{ emailBody.bodyContent }}
{%- else -%}
{%- endif %}
{%- endmacro %}