diff --git a/.env.example b/.env.example index aaffc13..66bfefa 100644 --- a/.env.example +++ b/.env.example @@ -26,6 +26,8 @@ EMAIL_SMTP_USER=CHANGE_ME_GMAIL_ADDRESS EMAIL_SMTP_PASSWORD=CHANGE_ME_GOOGLE_APP_PASSWORD EMAIL_FROM=CHANGE_ME_GMAIL_ADDRESS EMAIL_FROM_NAME=Jobbjakt +EMAIL_FOLLOWUPREMINDERS_ENABLED=true +EMAIL_FOLLOWUPREMINDERS_UPCOMINGDAYS=2 EMAIL_SMTP_ENABLE_SSL=true EMAIL_SMTP_TIMEOUT_MS=15000 diff --git a/JobTrackerApi/Services/FollowUpReminderHostedService.cs b/JobTrackerApi/Services/FollowUpReminderHostedService.cs index 8694791..151adaa 100644 --- a/JobTrackerApi/Services/FollowUpReminderHostedService.cs +++ b/JobTrackerApi/Services/FollowUpReminderHostedService.cs @@ -42,7 +42,7 @@ public sealed class FollowUpReminderHostedService : BackgroundService var enabled = _cfg.GetValue("Email:FollowUpReminders:Enabled", false); if (!enabled) return; - var baseUrl = (_cfg["App:BaseUrl"] ?? _cfg["Frontend:BaseUrl"] ?? string.Empty).Trim().TrimEnd('/'); + var baseUrl = (_cfg["App:PublicBaseUrl"] ?? _cfg["App:BaseUrl"] ?? _cfg["Frontend:BaseUrl"] ?? string.Empty).Trim().TrimEnd('/'); if (string.IsNullOrWhiteSpace(baseUrl)) return; using var scope = _services.CreateScope(); diff --git a/README.md b/README.md index 976a939..1c1e9d6 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,8 @@ Common keys: - `Email:SmtpPassword`: SMTP password (for Gmail: use an App Password) - `Email:From`: from address (default: `Email:SmtpUser`) - `Email:FromName`: from name (default: `Jobbjakt`) +- `Email:FollowUpReminders:Enabled`: enable scheduled follow-up reminder emails +- `Email:FollowUpReminders:UpcomingDays`: how far ahead reminder emails look for upcoming follow-up dates (default `2`) ### UI settings diff --git a/deploy/README.md b/deploy/README.md index cd187f3..6fc78ba 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -52,6 +52,8 @@ AUTH_ADMIN_EMAIL=you@example.com AUTH_ADMIN_PASSWORD=replace_with_strong_password APP_PUBLIC_BASE_URL=https://your-domain.example AI_SERVICE_BASE_URL=http://ai-service:8001 +EMAIL_FOLLOWUPREMINDERS_ENABLED=true +EMAIL_FOLLOWUPREMINDERS_UPCOMINGDAYS=2 # Optional backward-compatible alias if older config still references the previous name: SUMMARIZER_BASE_URL=http://ai-service:8001 ``` @@ -93,3 +95,4 @@ If this app is going to be a real production service on Ubuntu: - confirm backend can connect to MariaDB - confirm AI service container is reachable from backend - confirm reminder and admin/system pages load +- verify follow-up reminder emails are enabled only when intended and that links open the correct job/tab