Add buttons to actually send emails either the test address or mailing list

This commit is contained in:
2024-04-23 20:48:46 +01:00
parent 45d25d8990
commit ed872ddfa3
4 changed files with 159 additions and 32 deletions

View File

@@ -19,15 +19,28 @@
<div class="content">
<h1> This is an input </h1>
<div class="row">
<div class="column">
<div class="column" stye="align-items: center">
<div style="display: flex; justify-content: space-between;">
<span class="input_label">Subject:</span>
<input name="subject" type="text" id="subject" hx-post="/subject_preview"
hx-trigger="keyup changed delay:1000ms" hx-target="#subject-preview">
</div><br>
<textarea name="email_input" id="typebox" rows="32" cols="64" style="resize: none;"
<textarea name="email_input" id="email_input" rows="32" cols="64" style="resize: none;"
hx-trigger="keyup changed delay:1000ms" hx-post="/mail-content" hx-target="#email-preview"
placeholder="Type out your email here..."></textarea>
<br>
<div class="row" style="justify-content: space-around;">
<button hx-post="/send_email" hx-include="[id='email_input'], [id='subject']"
hx-vals='{"destination": "test"}' hx-swap="none">
Send Test Email
</button>
<button hx-post="/send_email" hx-include="[id='email_input'], [id='subject']"
hx-vals='{"destination": "mailing_list"}'
hx-confirm="You are about to send an email to your entire mailing list. Are you sure?"
hx-swap="none">
Send Email
</button>
</div>
</div>
<div class="column">
@@ -54,7 +67,7 @@
{{ block "mailing_list" . }}
<ul style="columns: 2;">
{{ range .Emails }}
{{ range . }}
<li><a href="mailto:{{ . }}"> {{ . }} </a></li>
{{end}}
</ul>