feat: branded HTML verification email + fix stale df_free placeholder
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 10m44s
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 10m44s
This commit is contained in:
parent
94586e38a4
commit
272c03c38d
3 changed files with 30 additions and 3 deletions
|
|
@ -644,7 +644,7 @@ html, body {
|
|||
<h2>Change your email</h2>
|
||||
<p>Enter your API key and new email address.</p>
|
||||
<div class="signup-error" id="emailChangeError"></div>
|
||||
<input type="text" id="emailChangeApiKey" aria-label="Your API key" placeholder="Your API key (df_free_... or df_pro_...)" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:12px;font-family:monospace;" required>
|
||||
<input type="text" id="emailChangeApiKey" aria-label="Your API key" placeholder="Your API key (df_pro_...)" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:12px;font-family:monospace;" required>
|
||||
<input type="email" id="emailChangeNewEmail" aria-label="New email address" placeholder="new.email@example.com" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:16px;" required>
|
||||
<button class="btn btn-primary" style="width:100%" id="emailChangeBtn">Send Verification Code →</button>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.8rem;text-align:center;">A verification code will be sent to your new email</p>
|
||||
|
|
|
|||
|
|
@ -644,7 +644,7 @@ html, body {
|
|||
<h2>Change your email</h2>
|
||||
<p>Enter your API key and new email address.</p>
|
||||
<div class="signup-error" id="emailChangeError"></div>
|
||||
<input type="text" id="emailChangeApiKey" aria-label="Your API key" placeholder="Your API key (df_free_... or df_pro_...)" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:12px;font-family:monospace;" required>
|
||||
<input type="text" id="emailChangeApiKey" aria-label="Your API key" placeholder="Your API key (df_pro_...)" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:12px;font-family:monospace;" required>
|
||||
<input type="email" id="emailChangeNewEmail" aria-label="New email address" placeholder="new.email@example.com" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:16px;" required>
|
||||
<button class="btn btn-primary" style="width:100%" id="emailChangeBtn">Send Verification Code →</button>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.8rem;text-align:center;">A verification code will be sent to your new email</p>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,34 @@ export async function sendVerificationEmail(email: string, code: string): Promis
|
|||
from: smtpFrom,
|
||||
to: email,
|
||||
subject: "DocFast - Verify your email",
|
||||
text: `Your DocFast verification code is: ${code}\n\nThis code expires in 15 minutes.\n\nIf you didn't request this, ignore this email.`,
|
||||
text: `Your DocFast verification code is: ${code}\n\nThis code expires in 15 minutes.\n\nIf you didn't request this, ignore this email.\n\n---\nDocFast — HTML to PDF API\nhttps://docfast.dev`,
|
||||
html: `<!DOCTYPE html>
|
||||
<html><body style="margin:0;padding:0;background:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="background:#0a0a0a;padding:40px 0;">
|
||||
<tr><td align="center">
|
||||
<table width="480" cellpadding="0" cellspacing="0" style="background:#111;border-radius:12px;padding:40px;">
|
||||
<tr><td align="center" style="padding-bottom:24px;">
|
||||
<h1 style="margin:0;font-size:28px;font-weight:700;color:#44ff99;letter-spacing:-0.5px;">DocFast</h1>
|
||||
</td></tr>
|
||||
<tr><td align="center" style="padding-bottom:8px;">
|
||||
<p style="margin:0;font-size:16px;color:#e8e8e8;">Your verification code</p>
|
||||
</td></tr>
|
||||
<tr><td align="center" style="padding-bottom:24px;">
|
||||
<div style="display:inline-block;background:#0a0a0a;border:2px solid #44ff99;border-radius:8px;padding:16px 32px;font-family:monospace;font-size:32px;letter-spacing:8px;color:#44ff99;font-weight:700;">${code}</div>
|
||||
</td></tr>
|
||||
<tr><td align="center" style="padding-bottom:8px;">
|
||||
<p style="margin:0;font-size:14px;color:#999;">This code expires in 15 minutes.</p>
|
||||
</td></tr>
|
||||
<tr><td align="center" style="padding-bottom:24px;">
|
||||
<p style="margin:0;font-size:14px;color:#999;">If you didn't request this, ignore this email.</p>
|
||||
</td></tr>
|
||||
<tr><td align="center" style="border-top:1px solid #222;padding-top:20px;">
|
||||
<p style="margin:0;font-size:12px;color:#666;">DocFast — HTML to PDF API<br><a href="https://docfast.dev" style="color:#44ff99;text-decoration:none;">docfast.dev</a></p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body></html>`,
|
||||
});
|
||||
logger.info({ email, messageId: info.messageId }, "Verification email sent");
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue