Files
email_alerts_v2/templates/config.html
T
bolade d553d6f31e Implement email alert system with WhatsApp notifications
- Added alerts processing logic in src/alerts.py to analyze threads and send WhatsApp alerts based on configured time frames.
- Created FastAPI application in src/app.py to manage threads, display configurations, and trigger alert processing.
- Developed database models and utility functions in src/database.py for managing threads and messages.
- Integrated Twilio API for sending WhatsApp messages in src/whatsapp_sender.py.
- Implemented Zoho email client in src/zoho_client.py to fetch emails and check for replies.
- Added configuration management for email settings and alert parameters.
- Established auto-processing loop for periodic email syncing and alert generation.
2025-08-11 17:34:35 +01:00

100 lines
3.1 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="row mb-2">
<div class="col">
<h2>Configuration</h2>
{% if saved %}
<p class="badge success">Saved</p>
{% endif %}
<p class="muted">Edit core settings for triage, time frames, and processing.</p>
</div>
</div>
<form class="card" method="post" action="/config">
<h3>General</h3>
<div class="row">
<div class="col">
<label>Email Address<br>
<input type="email" name="email_address" value="{{ cfg.email_address }}" />
</label>
</div>
<div class="col">
<label>Days Back to Fetch<br>
<input type="number" name="email_days_back" min="1" max="60" value="{{ cfg.email_days_back }}" />
</label>
</div>
</div>
<div class="row mt-1">
<div class="col">
<label>Agency Domains (comma or newline separated)<br>
<textarea name="agency_domains" rows="3">{{ cfg.agency_domains | join(', ') }}</textarea>
</label>
</div>
</div>
<h3 class="mt-2">Zoho (optional)</h3>
<div class="row">
<div class="col">
<label>Zoho Email<br>
<input type="text" name="zoho_email" value="{{ cfg.zoho_email }}" />
</label>
</div>
<div class="col">
<label>Zoho App Password<br>
<input type="password" name="zoho_app_password" value="{{ cfg.zoho_app_password }}" />
</label>
</div>
</div>
<h3 class="mt-2">WhatsApp</h3>
<div class="row">
<div class="col">
<label>Send To (WhatsApp E.164, no spaces)<br>
<input type="text" name="whatsapp_to" placeholder="+15551234567" value="{{ cfg.whatsapp_to or '' }}" />
</label>
</div>
</div>
<h3 class="mt-2">Processing</h3>
<div class="row">
<div class="col">
<label><input type="checkbox" name="auto_process" {% if cfg.auto_process %}checked{% endif %}/> Auto Process</label>
</div>
<div class="col">
<label>Process Interval (minutes)<br>
<input type="number" name="auto_process_interval" min="1" max="360" value="{{ cfg.auto_process_interval }}" />
</label>
</div>
</div>
<h3 class="mt-2">Alert Time Frames</h3>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Name</th>
<th>Hours</th>
<th>Alert Level</th>
</tr>
</thead>
<tbody>
{% set frames = cfg.time_frames %}
{% for i in rows %}
{% set row = frames[i] if frames and i < frames|length else None %}
<tr>
<td><input type="text" name="time_name_{{ i }}" value="{{ row.name if row else '' }}" /></td>
<td><input type="number" name="time_hours_{{ i }}" min="0" max="168" value="{{ row.hours if row else '' }}" /></td>
<td><input type="number" name="time_alert_{{ i }}" min="0" max="10" value="{{ row.alert_level if row else '' }}" /></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="right mt-2">
<button type="submit">Save</button>
</div>
</form>
{% endblock %}