{#
/**
 * Copyright © 2003-2024 The Galette Team
 *
 * This file is part of Galette (https://galette.eu).
 *
 * Galette is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Galette is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
 */
#}
    {% set count = mailing.recipients|length %}
    {% set count_unreachables = mailing.unreachables|length %}
    {% if count > 0 %}
        {% if mailing.current_step == constant('Galette\\Core\\Mailing::STEP_SENT') %}
                <p>{{ _T("Your message has been sent to <strong>%s members</strong>")|replace({'%s': count}) }}</p>
        {% else %}
                <p id="recipients_count">{{ _T("You are about to send an e-mail to <strong>%s members</strong>")|replace({'%s': count})|raw }}</p>
        {% endif %}
    {% else %}
        {% if count_unreachables > 0 %}
                <p id="recipients_count"><em>{{ _T("None of the selected members has an email address.") }}</em></p>
         {% else %}
                <p id="recipients_count"><em>{{ _T("No member selected (yet).") }}</em></p>
         {% endif %}
    {% endif %}
    {% if count_unreachables > 0 %}
                <div id="unreachables_count" class="ui message">
                    <div class="header">
                        {{ count_unreachables }} {% if count_unreachables != 1 %}{{ _T("unreachable members:") }}{% else %}{{ _T("unreachable member:") }}{% endif %}
                    </div>
                    <p>{{ _T("Some members you have selected have no e-mail address. However, you can generate envelope labels to contact them by snail mail.") }}</p>
                    <a class="ui basic labeled icon button" href="{{ url_for('pdf-members-labels') }}?from=mailing"><i class="th icon" aria-hidden="true"></i> {{ _T("Generate labels") }}</a>
                </div>
    {% endif %}
