Files
paul a3546b4c01 Security hardening: env-based config, CSRF protection, secure code generation, plus presenter management and email communications system
- Move all credentials from hardcoded to .env with python-dotenv (add .env.example template and .gitignore)
- Add CSRF token generation and validation on all state-changing requests
- Replace random.choices with secrets.choice for all secure code generation
- Add session cookie security headers (HttpOnly, Secure, SameSite)
- Add presenter management: assign/remove presenters to breakout sessions, presenter QR scanning
- Add email communications system: templates per event, custom email sending, sent email tracking
- Add staff/organizer profile pages with staff code display
- New DB tables: event_email_templates, sent_emails, user_communications
- New DB columns: staff.reminder_count/reminder_dates, breakout_session_organizers.presenter_code
- Expand English translation strings across all new features

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-26 20:34:48 +00:00

88 lines
3.8 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ 'send_email'|t }} - {{ event.name }}{% endblock %}
{% block content %}
<div class="communications-send-page">
<div class="page-header">
<h1>{{ 'send_custom_email'|t }}</h1>
<a href="{{ url_for('event_communications', event_id=event.id) }}" class="btn btn-outline"><i data-lucide="arrow-left"></i> {{ 'back'|t }}</a>
</div>
<div class="section-box">
<form method="POST" class="send-email-form">
<div class="form-group">
<label for="recipient_type">{{ 'recipient_type'|t }}</label>
<select id="recipient_type" name="recipient_type" required onchange="toggleRecipientSelection()">
<option value="">{{ 'select_recipient_type'|t }}</option>
<option value="all_attendees">{{ 'all_attendees'|t }}</option>
<option value="all_staff">{{ 'all_staff'|t }}</option>
<option value="attendee">{{ 'specific_attendees'|t }}</option>
<option value="staff">{{ 'specific_staff'|t }}</option>
</select>
</div>
<div id="recipient-selection" class="form-group d-none">
<label>{{ 'select_recipients'|t }}</label>
<div class="recipient-list">
<div id="attendee-list" class="d-none">
{% for attendee in attendees %}
<label class="checkbox-label">
<input type="checkbox" name="recipient_ids" value="{{ attendee.id }}"> <span class="first-name">{{ attendee.first_name }}</span> <span class="last-name">{{ attendee.last_name }}</span> ({{ attendee.email }})
</label>
{% endfor %}
</div>
<div id="staff-list" class="d-none">
{% for s in staff_members %}
<label class="checkbox-label">
<input type="checkbox" name="recipient_ids" value="{{ s.id }}"> <span class="first-name">{{ s.first_name }}</span> <span class="last-name">{{ s.last_name }}</span> ({{ s.email }})
</label>
{% endfor %}
</div>
</div>
</div>
<div class="form-group">
<label for="subject">{{ 'subject'|t }}</label>
<input type="text" id="subject" name="subject" required>
</div>
<div class="form-group">
<label for="body">{{ 'message'|t }}</label>
<textarea id="body" name="body" rows="10" required></textarea>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary"><i data-lucide="send"></i> {{ 'send_email'|t }}</button>
</div>
</form>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
lucide.createIcons();
});
function toggleRecipientSelection() {
const recipientType = document.getElementById('recipient_type').value;
const attendeeList = document.getElementById('attendee-list');
const staffList = document.getElementById('staff-list');
const recipientSelection = document.getElementById('recipient-selection');
// Hide both first
attendeeList.classList.add('d-none');
staffList.classList.add('d-none');
if (recipientType === 'attendee') {
recipientSelection.classList.remove('d-none');
attendeeList.classList.remove('d-none');
} else if (recipientType === 'staff') {
recipientSelection.classList.remove('d-none');
staffList.classList.remove('d-none');
} else {
recipientSelection.classList.add('d-none');
}
}
</script>
{% endblock %}