Switch email provider from Resend to Mailgun and add cron scheduler
Some checks failed
Deploy / deploy (push) Failing after 1m43s

- Replace resend package with mailgun.js and form-data
- Update email.ts to use Mailgun API with lazy client initialization
- Add instrumentation.ts to schedule cron jobs (notifications :00, Garmin :30)
- Update tests for Mailgun mock structure
- Update .env.example with MAILGUN_API_KEY and MAILGUN_DOMAIN

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 19:37:24 +00:00
parent 6543c79a04
commit ccbc86016d
6 changed files with 369 additions and 104 deletions

View File

@@ -11,8 +11,9 @@ NODE_ENV=development
POCKETBASE_URL=http://localhost:8090
NEXT_PUBLIC_POCKETBASE_URL=http://localhost:8090
# Email (Resend)
RESEND_API_KEY=re_xxxxxxxxxxxx
# Email (Mailgun)
MAILGUN_API_KEY=key-xxxxxxxxxxxx
MAILGUN_DOMAIN=yourdomain.com
EMAIL_FROM=phaseflow@yourdomain.com
# Encryption (for Garmin tokens)