Report PDF emailing

This commit is contained in:
2026-06-18 21:07:34 +01:00
parent 7254719794
commit 364f4fe57e
16 changed files with 1428 additions and 16 deletions
+20 -1
View File
@@ -7,7 +7,7 @@
<div>
<p class="eyebrow">Reports</p>
<h1>Build a temperature report</h1>
<p class="muted">Choose a date range and export the summary as CSV.</p>
<p class="muted">Choose a date range, export CSV, or send a PDF report.</p>
</div>
</section>
@@ -33,6 +33,25 @@
<a class="button secondary" href="/reports.csv?start={{ start }}&end={{ end }}&device_id={{ device_id }}">Download CSV</a>
</form>
<section class="panel report-email-panel">
<div class="panel-heading">
<div>
<h2>Email PDF report</h2>
<p class="muted">Creates a PDF using the selected range and device filter, then sends it via SMTP2GO.</p>
</div>
</div>
<form class="report-form email-report-form" method="post" action="/reports/email-pdf">
<input type="hidden" name="start" value="{{ start }}">
<input type="hidden" name="end" value="{{ end }}">
<input type="hidden" name="device_id" value="{{ device_id }}">
<label>
Email
<input type="email" name="email" placeholder="recipient@example.com" required>
</label>
<button class="button" type="submit">Create and email PDF</button>
</form>
</section>
<section class="panel">
<div class="table-wrap">
<table>