{% set CDN_URL = "https://cdn.theorchard.io/"%}
{% set ICONS_URL = CDN_URL ~ 'web-icons' %}
{% set IMAGES_URL = CDN_URL ~ 'images' %}
{% set ASSETS_URL = CDN_URL ~ 'assets' %}

{% set BRAND_ID_ORCHARD = 'orchard' %}
{% set BRAND_ID_AWAL = 'awal' %}
{% set BRAND_ID_SME = 'sme' %}
{% set BRAND_ID_KNR = 'knr' %}
{% set SUPPORTED_BRANDS = (
    BRAND_ID_ORCHARD,
    BRAND_ID_AWAL,
    BRAND_ID_SME,
    BRAND_ID_KNR,
) %}

{# Fallback to "orchard" brand #}
{% set BRAND_ID = default_brand if default_brand in SUPPORTED_BRANDS else BRAND_ID_ORCHARD %}
{# Workaround for orchard/theorchard #}
{% set BRAND_TEMPLATE = BRAND_ID if BRAND_ID != BRAND_ID_ORCHARD else 'theorchard' %}


{% set BRAND_VARS_PATH = 'include/vars/' ~ BRAND_TEMPLATE ~ '.jinja' %}
{% import BRAND_VARS_PATH as brand_vars with context %}

<html lang="{{ lang }}">
    <head>
        {% include 'include/user_permissions_updated/css.jinja' %}
        {{ brand_vars.EXTRA_HEAD }}
        {# Title will not be displayed in e-mail but it's used to translate the subject #}
        <title>
            {% trans tenant_name = tenant_name %}
                Update: Your access for {{ tenant_name }}
            {% endtrans %}
        </title>
    </head>

    <body class="user_invitation__v2">
        <table>
            {% include 'include/user_permissions_updated/logo.jinja' %}
            {% include 'include/user_permissions_updated/header.jinja' %}
            {% include 'include/user_permissions_updated/body.jinja' %}
            {% include 'include/user_permissions_updated/app_access.jinja' %}
            {% include 'include/user_permissions_updated/footer_links.jinja' %}
        </table>
        {% if tracking_url %}
        <img src="{{ tracking_url }}" alt="">
        {% endif %}
    </body>
</html>
