{% if show_button is not defined or show_button %}
    <button
        type="button"
        class="btn btn-info btn-rounded"
        data-toggle="modal"
        data-target="#{{ modal_id }}"
    >
        <i class="fas fa-paper-plane" aria-hidden="true"></i>
        {{ 'marketing.test_email.button'|trans }}
    </button>
{% endif %}

{% if show_modal is not defined or show_modal %}
    <div class="modal fade" id="{{ modal_id }}" tabindex="-1" role="dialog" aria-labelledby="{{ modal_id }}Title">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <form method="post" action="{{ action }}">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="{{ 'marketing.test_email.cancel'|trans }}">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title" id="{{ modal_id }}Title">
                            {{ 'marketing.test_email.modal_title'|trans }}
                        </h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="{{ modal_id }}Recipient">{{ 'marketing.test_email.recipient'|trans }}</label>
                            <input
                                id="{{ modal_id }}Recipient"
                                class="form-control"
                                type="email"
                                name="email"
                                value="{{ recipient }}"
                                autocomplete="email"
                                required
                            >
                            <p class="help-block">{{ 'marketing.test_email.recipient_help'|trans }}</p>
                        </div>
                        <div class="alert alert-info">
                            {{ 'marketing.test_email.fake_data_notice'|trans }}
                            {{ 'marketing.test_email.saved_configuration_notice'|trans }}
                        </div>
                        <input type="hidden" name="_token" value="{{ csrf_token(csrf_token_id) }}">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">
                            {{ 'marketing.test_email.cancel'|trans }}
                        </button>
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-paper-plane" aria-hidden="true"></i>
                            {{ 'marketing.test_email.send'|trans }}
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endif %}
