{% extends "crm/base.html" %}

{% block content %}
<div class="container mt-4">
    <h2>Send Bulk Email</h2>

    <form method="post">
        {% csrf_token %}

        <div class="mb-3">
            <label class="form-label">{{ form.prospects.label }}</label>
            {{ form.prospects }}
            {% if form.prospects.errors %}
                <div class="alert alert-danger">
                    {{ form.prospects.errors }}
                </div>
            {% endif %}
        </div>

        <div class="mb-3">
            <label class="form-label">{{ form.subject.label }}</label>
            {{ form.subject }}
            {% if form.subject.errors %}
                <div class="alert alert-danger">
                    {{ form.subject.errors }}
                </div>
            {% endif %}
        </div>

        <div class="mb-3">
            <label class="form-label">{{ form.content.label }}</label>
            {{ form.content }}
            {% if form.content.errors %}
                <div class="alert alert-danger">
                    {{ form.content.errors }}
                </div>
            {% endif %}
            <div class="form-text">
                You can use {name} to insert the prospect's name.
            </div>
        </div>

        <button type="submit" class="btn btn-primary">Send Email</button>
        <a href="{% url 'crm:prospect-list' %}" class="btn btn-secondary">Cancel</a>
    </form>
</div>
{% endblock %}
