feat(mail): add smtp email delivery
This commit is contained in:
parent
faddaa91d0
commit
3456b04ed4
25 changed files with 529 additions and 60 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import { redirect } from "next/navigation";
|
||||
import AdminShell from "@/components/admin/AdminShell";
|
||||
import SmtpSettingsForm from "@/components/admin/SmtpSettingsForm";
|
||||
import { requireAdminSession } from "@/lib/admin/auth";
|
||||
import { getSmtpSettings } from "@/lib/admin/store";
|
||||
import { getSmtpSettings, isSmtpConfigured, toPublicSmtpSettings } from "@/lib/mail/config";
|
||||
|
||||
export default async function AdminSmtpPage() {
|
||||
if (!await requireAdminSession()) redirect("/admin/login");
|
||||
|
|
@ -13,16 +14,7 @@ export default async function AdminSmtpPage() {
|
|||
<p className="eyebrow">E-Mail</p>
|
||||
<h1>SMTP Einstellungen</h1>
|
||||
</div>
|
||||
<form className="admin-card admin-form" action="/api/admin/smtp" method="post">
|
||||
<label>SMTP Server<input name="host" defaultValue={settings.host} /></label>
|
||||
<label>Port<input name="port" defaultValue={settings.port} inputMode="numeric" /></label>
|
||||
<label>Benutzername<input name="username" defaultValue={settings.username} /></label>
|
||||
<label>Passwort<input name="password" type="password" placeholder="wird in dieser Foundation noch nicht gespeichert" disabled /></label>
|
||||
<label>Absenderadresse<input name="fromAddress" type="email" defaultValue={settings.fromAddress} /></label>
|
||||
<label>Antwortadresse<input name="replyToAddress" type="email" defaultValue={settings.replyToAddress} /></label>
|
||||
<label className="admin-checkbox"><input name="tls" type="checkbox" defaultChecked={settings.tls} /> TLS aktivieren</label>
|
||||
<button className="button" type="submit">Speichern</button>
|
||||
</form>
|
||||
<SmtpSettingsForm initialSettings={toPublicSmtpSettings(settings)} configured={isSmtpConfigured(settings)} />
|
||||
</AdminShell>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue