{% load i18n %} {% load widget_tweaks %}
<h2 class="oh-inner-sidebar-content__title">{% trans "Send Test Email" %}</h2>
<form hx-post="{% url "mail-server-test-email" %}?instance_id={{instance_id}}">
    {% csrf_token %}
    {% for field in form %}
    {% if field.field.widget.is_hidden %}
      {{ field }}
    {% endif %}
  {% endfor %}
    <div class="oh-general__tab-target oh-profile-section" id="test_email">
        <div class="oh-profile-section__card">
          <div class="row">
            <div class="col-12">{{form.non_field_errors}}</div>
            {% for field in form.visible_fields %}
            <div class="col-12 col-md-6" id="id_{{ field.name }}_parent_div">
              <label
                class="oh-label {% if field.field.required %} required-star{% endif %}"
                for="id_{{ field.name }}"
                title="{{ field.help_text|safe }}">
                {% trans field.label %}
                </label>
                {{ field|add_class:"oh-input w-100 form-control" }}

                {{field.errors}}
            </div>
            {% endfor %}

          </div>

          <div class="oh-modal__dialog-footer p-0 mt-3">
            <button
              type="submit"
              class="oh-btn oh-btn--secondary oh-btn--shadow"
            >
              {% trans "Send Email" %}
            </button>
          </div>
        </div>
      </div>

</form>
<p>
    {{send_test_mail_result}}
</p>
