{% extends "kegadmin/base.html" %}
{% load kegweblib %}
{% load crispy_forms_tags %}

{% block title %}Kegbot Admin: E-Mail | {{ block.super }}{% endblock %}
{% block pagetitle %}Kegbot Admin: E-Mail{% endblock %}

{% block kegadmin-main %}
{% if not email_configured %}
<div class="alert alert-error">
  <h4>Warning!</h4>
   E-mail is not properly configured; no mails will be sent.  Please
   <a href="https://kegbot.org/docs/server/extras/">read the docs</a>
   for more information (hint: set <code>EMAIL_BACKEND</code> and
   <code>EMAIL_FROM_ADDRESS</code> in <code>local_settings.py</code>).
</div>
{% else %}
  <h2>Test E-mail Configuration</h2>
  <p class="lead">
    Use this panel to test your server's e-mail configuration.
  </p>
  <form action="" class="user-select" method="POST">{% csrf_token %}
    <input type="hidden" name="address" value="{{ user.email }}">
    <button class="btn btn-info" name="send_test_email" type="submit">
      Send Test E-mail to {{ user.email }}
    </button>
  </form>
  <p class="muted ">
    Please check your inbox at the address above after sending a test E-mail.
    Be sure to check your spam folder, and add the sender to your whitelist if necessary.
  </p>
{% endif %}

{% endblock %}
