feat: add mailer functions for FamilyGuard flyer notification and link
This commit is contained in:
parent
331e89f73d
commit
e3fad32b6b
|
|
@ -209,3 +209,86 @@ export async function sendeKontaktEmail(
|
|||
`Kontaktanfrage ${data.name}`
|
||||
);
|
||||
}
|
||||
|
||||
export async function sendeFlyerBenachrichtigung(
|
||||
data: { email: string }
|
||||
): Promise<{ sent: boolean; queued: boolean }> {
|
||||
const html = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head><meta charset="UTF-8"></head>
|
||||
<body style="font-family:system-ui,sans-serif;color:#e2e8f0;max-width:600px;margin:0 auto;padding:0">
|
||||
<div style="background:#18212f;padding:20px 24px;border-bottom:2px solid #f97316">
|
||||
<h1 style="color:#f97316;margin:0;font-size:20px;font-weight:700">MBO Tech IT</h1>
|
||||
<p style="color:rgba(255,255,255,0.6);margin:4px 0 0;font-size:13px">FamilyGuard Flyer-Download</p>
|
||||
</div>
|
||||
<div style="padding:24px;background:#1e2a3b">
|
||||
<h2 style="margin:0 0 16px;font-size:18px;color:#f8fafc">Neuer Flyer-Download</h2>
|
||||
<p style="color:#94a3b8;margin:0 0 16px;line-height:1.6">
|
||||
Ein Interessent hat den MBO FamilyGuard Flyer angefordert.
|
||||
</p>
|
||||
<table style="width:100%;border-collapse:collapse">
|
||||
<tr><td style="padding:6px 0;color:#94a3b8;width:120px">E-Mail</td><td style="padding:6px 0"><a href="mailto:${data.email}" style="color:#60a5fa">${data.email}</a></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="padding:12px 24px;background:#111925;border-top:1px solid rgba(255,255,255,0.1)">
|
||||
<p style="margin:0;font-size:11px;color:#64748b">MBO Tech IT · ${process.env.APP_URL ?? "https://mbo-tech-it.de"}</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
return sendWithFallback(
|
||||
{
|
||||
from: `"MBO Tech IT" <${process.env.SMTP_FROM}>`,
|
||||
to: "jonny@mbo-tech-it.de",
|
||||
replyTo: data.email,
|
||||
subject: `Neuer FamilyGuard-Flyer-Download: ${data.email}`,
|
||||
text: `Neuer Flyer-Download\n\nE-Mail: ${data.email}`,
|
||||
html,
|
||||
},
|
||||
`FamilyGuard-Flyer-Benachrichtigung ${data.email}`
|
||||
);
|
||||
}
|
||||
|
||||
export async function sendeFlyerLink(data: { email: string }): Promise<void> {
|
||||
const downloadLink = `${process.env.APP_URL ?? "https://mbo-tech-it.de"}/downloads/MBO_FamilyGuard_Flyer_01.pdf`;
|
||||
const html = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head><meta charset="UTF-8"></head>
|
||||
<body style="font-family:system-ui,sans-serif;color:#e2e8f0;max-width:600px;margin:0 auto;padding:0">
|
||||
<div style="background:#18212f;padding:20px 24px;border-bottom:2px solid #f97316">
|
||||
<h1 style="color:#f97316;margin:0;font-size:20px;font-weight:700">MBO Tech IT</h1>
|
||||
<p style="color:rgba(255,255,255,0.6);margin:4px 0 0;font-size:13px">MBO FamilyGuard</p>
|
||||
</div>
|
||||
<div style="padding:24px;background:#1e2a3b">
|
||||
<h2 style="margin:0 0 16px;font-size:18px;color:#f8fafc">Ihr FamilyGuard-Flyer</h2>
|
||||
<p style="color:#94a3b8;margin:0 0 24px;line-height:1.6">
|
||||
Vielen Dank für Ihr Interesse an MBO FamilyGuard. Den Flyer mit allen Details
|
||||
finden Sie hier zum Download:
|
||||
</p>
|
||||
<a href="${downloadLink}"
|
||||
style="display:inline-block;background:#f97316;color:#fff;font-weight:700;padding:12px 24px;border-radius:8px;text-decoration:none;font-size:15px">
|
||||
Flyer herunterladen
|
||||
</a>
|
||||
<p style="color:#64748b;font-size:12px;margin:24px 0 0">
|
||||
Fragen? Rufen Sie uns an: <a href="tel:+4917193451093" style="color:#f97316">+49 171 9345193</a>
|
||||
</p>
|
||||
</div>
|
||||
<div style="padding:12px 24px;background:#111925;border-top:1px solid rgba(255,255,255,0.1)">
|
||||
<p style="margin:0;font-size:11px;color:#64748b">MBO Tech IT · ${process.env.APP_URL ?? "https://mbo-tech-it.de"}</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
await sendWithFallback(
|
||||
{
|
||||
from: `"MBO Tech IT" <${process.env.SMTP_FROM}>`,
|
||||
to: data.email,
|
||||
subject: "Ihr MBO FamilyGuard Flyer",
|
||||
text: `Hallo,\n\nvielen Dank für Ihr Interesse an MBO FamilyGuard. Den Flyer finden Sie hier:\n${downloadLink}\n\nMBO Tech IT`,
|
||||
html,
|
||||
},
|
||||
`FamilyGuard-Flyer-Link ${data.email}`
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue