feat: upgrade verification code email with bilingual HTML template

- Chinese domains (qq.com, 163.com, etc.) receive a Chinese email
- All other domains receive an English email
- Prominent code display: 40px monospace with wide letter-spacing
- Clean OpenAI-inspired layout with dark header and card design

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 14:44:17 +08:00
parent 87bee98049
commit 876e64366b
2 changed files with 167 additions and 2 deletions

View File

@@ -130,8 +130,7 @@ func (svc *UserService) SendEmailVerifyCode(ctx context.Context, emailAddr strin
code := fmt.Sprintf("%06d", rand.Intn(1000000))
subject := "Your verification code"
body := fmt.Sprintf("Your verification code is: %s\nIt will expire in 10 minutes.", code)
subject, body := email.BuildVerifyCodeEmail(emailAddr, code)
if err := email.Send(ctx, emailAddr, subject, body); err != nil {
log.Error(ctx, "func", "SendEmailVerifyCode", "msg", "send email error", "error", err)
return err