Backend: - app/models/email_log.py: EmailLog table (school_id, to, subject, type, status, error, sent_at) with EmailType + EmailStatus enums - migrations/002_phase9_email_logs.py: Alembic migration for email_logs table - app/templates/email/: 6 Jinja2 HTML templates — base layout, invoice, low_credit, license_expiry, overdue_warning, suspension - app/services/email.py: enhanced send_email() — accepts template_name+context for HTML rendering, logs every attempt to email_logs, retries up to 3x on transient SMTP failure with exponential backoff - app/routers/email.py: GET /api/email/logs (paginated, filterable by type/status/school), POST /api/email/test (send test email, super admin) - tasks/billing.py: invoice + overdue warning + suspension emails now use HTML templates - tasks/sms.py: low credit alert now uses HTML template - tasks/license.py: expiry warning now uses HTML template - app/main.py + migrations/env.py: wire in email_log model + email router Frontend: - EmailLogsPage.vue: table with to/subject/type badge/status badge/sent_at/error, type+status filters, pagination, Send Test Email modal - router/index.ts: /email-logs route - AppSidebar.vue: Email Logs nav item - api.ts: getEmailLogs, sendTestEmail
24 lines
1.1 KiB
HTML
24 lines
1.1 KiB
HTML
{% extends "email/base.html" %}
|
|
{% block content %}
|
|
<h2>Low SMS Credits — Action Required</h2>
|
|
<p>Dear {{ contact_name }},</p>
|
|
|
|
<div class="alert-amber">
|
|
<strong>Your SMS credit balance for {{ school_name }} is running low.</strong>
|
|
</div>
|
|
|
|
<div class="info-box">
|
|
<div class="row"><span class="label">School</span><span class="value">{{ school_name }}</span></div>
|
|
<div class="row"><span class="label">Current Balance</span><span class="value" style="color:#b45309">{{ credits_remaining }} credits</span></div>
|
|
<div class="row"><span class="label">Low Credit Threshold</span><span class="value">{{ threshold }} credits</span></div>
|
|
</div>
|
|
|
|
<p>SMS notifications to parents and guardians will stop working when your credit balance reaches zero.
|
|
Please top up your credits to ensure uninterrupted service.</p>
|
|
|
|
<p><a class="btn" href="{{ portal_url }}/portal/billing">Request Credit Top-Up</a></p>
|
|
|
|
<p>If you need assistance, contact us at <a href="mailto:support@taptrack.io">support@taptrack.io</a>.</p>
|
|
<p>Thank you,<br><strong>TapTrack Hub Team</strong></p>
|
|
{% endblock %}
|