fix: Ensure email configuration from environment variables is properly used

Fixed an issue where SMTP configuration would fall back to defaults despite
environment variables being set in docker-compose.yml. The email utility now
properly accesses runtime configuration by accepting the H3 event context.

Changes:
- Created getEmailConfig() helper with dual-strategy config access
- Pass event context from API handlers to email functions
- Added fallback to direct process.env access for reliability
- Added debug logging to diagnose configuration issues in production

This ensures Office365 and other SMTP providers work correctly when configured
via environment variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-05 18:11:13 -05:00
parent a689bee58b
commit 47b4a14c4b
3 changed files with 47 additions and 7 deletions

View File

@@ -89,7 +89,8 @@ export default defineEventHandler(async (event) => {
bibleReferencesText,
sermon.personal_appliance,
sermon.pastors_challenge,
userNotes
userNotes,
event
)
return {