{% extends 'emails/base.txt' %}

{%- block subject -%}
    [{{ req.definition.title }}] {% block request_subject %}{% endblock %}
{%- endblock -%}

{% block header %}{% endblock %}

{% block body -%}
    {%- filter dedent -%}
        {% block request_message %}{% endblock %}

        Event: {{ event.getTitle() }}
        Requested by: {{ req.created_by_user.getStraightFullName() }}
        Requested at: {{ req.created_dt | format_datetime }}
        Details: {{ url_for('requests.event_requests_details', req, _external=True) }}
        {%- if self.request_details() %}
            {# empty line #}
            {% block request_details %}{% endblock -%}
        {% endif -%}
    {%- endfilter %}
{% endblock %}

{% block footer_title %}Service Requests{% endblock %}

{% extends 'emails/base.txt' %}

{% set request_created_by = req.created_by_user %}
{% set event_created_by = event.getCreator() %}


{% macro user_details(user) -%}
    Name:     {{ user.getStraightFullName() }}
    Email:    {{ user.getEmail() }}
    {%- if user.getPhone() %}
    Phone:    {{ user.getPhone() }}
    {%- endif -%}
{%- endmacro %}


{% macro event_details(event) -%}
    Name:     {{ event.getTitle() }}
    {% if event.getStartDate().date() == event.getEndDate().date() -%}
    Date:     {{ event.getStartDate() | format_date }}, {{ event.getStartDate() | format_time }}
    {%- else -%}
    Dates:    {{ event.getStartDate() | format_date }}, {{ event.getStartDate() | format_time }} - {{ event.getEndDate() | format_date }}, {{ event.getEndDate() | format_time }}
    {%- endif %}
    Location: {% if event.getLocation() %}{{ event.getLocation().getName() }}: {% endif %}{% if event.getRoom() %}{{ event.getRoom().getName() }}{% endif %}
    Details:  {{ url_for('event.conferenceDisplay', event, _external=True) }}
{%- endmacro %}


{%- block subject -%}
    [{{ req.definition.title }}] {% block request_subject %}{% endblock %}
{%- endblock -%}


{% block header %}{% endblock %}


{% block body -%}
    {%- filter dedent -%}
        {% block request_message %}{% endblock %}
        {{ url_for('requests.event_requests_details', req, _external=True) }}

        {% filter underline %}Requested by{% endfilter %}
        {{ user_details(request_created_by) }}
        {%- if request_created_by != event_created_by %}

            {% filter underline %}Event created by{% endfilter %}
            {{ user_details(event_created_by) }}
        {%- endif %}

        {% filter underline %}Event details{% endfilter %}
        {{ event_details(event) }}

        {%- if self.request_details() %}

            {% filter underline %}Request details{% endfilter %}
            {% block request_details %}{% endblock -%}
        {% endif %}
    {%- endfilter %}
{% endblock %}


{% block footer_title %}Service Requests{% endblock %}

Improve mails to request managers
Improve mails to request managers
