{% extends 'layouts/base.html' %}
{% block content %}
<h2>Create Email Campaign</h2>
<form method="post">
    <div>
        <label>Name:</label>
        <input type="text" name="name" required>
    </div>
    <div>
        <label>Subject:</label>
        <input type="text" name="subject" required>
    </div>
    <div>
        <label>Content:</label>
        <textarea name="content" rows="6" required></textarea>
    </div>
    <div>
        <label>Schedule At (optional):</label>
        <input type="datetime-local" name="scheduled_at">
    </div>
    <div>
        <label>Recipients:</label>
        <select name="contacts" multiple required>
            {% for c in contacts %}
            <option value="{{ c[0] }}">{{ c[1] }} ({{ c[2] }})</option>
            {% endfor %}
        </select>
    </div>
    <button type="submit" class="action-button primary">Create Campaign</button>
</form>
{% endblock %}
