Files
gooseek/CONTINUE.md
home 52134df4d1
Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Failing after 8m22s
feat: add email notification service with SMTP support
- 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
2026-03-03 02:50:17 +03:00

54 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Email Notification Service
## Статус: Готово
## Что реализовано
### Пакет `backend/pkg/email/`
- `types.go` — типы уведомлений (Welcome, PasswordReset, LimitWarning, SpaceInvite, SystemAlert)
- `sender.go` — SMTP клиент с TLS, rate limiting (1 письмо/тип/24ч), async отправка
- `templates.go` — HTML шаблоны с брендингом GooSeek
### Интеграции
| Сервис | Уведомления | Файл |
|--------|-------------|------|
| auth-svc | Welcome, Password Reset | `backend/cmd/auth-svc/main.go` |
| llm-svc | Limit Warning (80%), Limit Exceeded (100%) | `backend/pkg/middleware/llm_limits.go` |
| thread-svc | Space Invite | `backend/cmd/thread-svc/main.go` |
### Новые API endpoints
- `POST /api/v1/spaces/:id/invite` — приглашение в Space по email
- `GET /api/v1/spaces/:id/invites` — список приглашений
### Конфигурация
```env
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=noreply@gooseek.ru
SMTP_PASSWORD=
SMTP_FROM=GooSeek <noreply@gooseek.ru>
SMTP_TLS=true
SITE_URL=https://gooseek.ru
SITE_NAME=GooSeek
```
## Файлы изменены
- `backend/pkg/email/types.go` — новый
- `backend/pkg/email/sender.go` — новый
- `backend/pkg/email/templates.go` — новый
- `backend/pkg/config/config.go` — SMTP конфиг
- `backend/pkg/middleware/jwt.go` — GetUserEmail()
- `backend/pkg/middleware/llm_limits.go` — email при лимитах
- `backend/internal/usage/repository.go` — GetUserEmail()
- `backend/cmd/auth-svc/main.go` — welcome + reset emails
- `backend/cmd/llm-svc/main.go` — emailSender в LLMLimits
- `backend/cmd/thread-svc/main.go` — invite endpoint + email
- `backend/deploy/k8s/configmap.yaml` — SMTP переменные
- `.env` — SMTP переменные
## Сервер
- IP: 5.187.77.89
- GPU: RTX 4060 Ti 16GB
- Site: https://gooseek.ru