feat: add email notification service with SMTP support
Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 8m22s

- Create pkg/email package (sender, templates, types)
- SMTP client with TLS, rate limiting, async sending
- HTML email templates with GooSeek branding
- Integrate welcome + password reset emails in auth-svc
- Add limit warning emails (80%/100%) in llm-svc middleware
- Add space invite endpoint with email notification in thread-svc
- Add GetUserEmail helper in JWT middleware
- Add SMTP config to .env, config.go, K8s configmap

Made-with: Cursor
This commit is contained in:
home
2026-03-03 02:50:17 +03:00
parent 7a40ff629e
commit 52134df4d1
12 changed files with 767 additions and 92 deletions

View File

@@ -156,6 +156,17 @@ func (r *Repository) GetUsageHistory(ctx context.Context, userID string, days in
return metrics, nil
}
func (r *Repository) GetUserEmail(ctx context.Context, userID string) (string, error) {
var emailAddr string
err := r.db.QueryRowContext(ctx,
"SELECT email FROM auth_users WHERE id = $1", userID,
).Scan(&emailAddr)
if err != nil {
return "", err
}
return emailAddr, nil
}
func (r *Repository) CheckLLMLimits(ctx context.Context, userID, tier string) (bool, string) {
usage, err := r.GetTodayUsage(ctx, userID)
if err != nil {