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:
@@ -31,7 +31,7 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
// Send email
|
||||
try {
|
||||
await sendPasswordResetEmail(email, code)
|
||||
await sendPasswordResetEmail(email, code, event)
|
||||
} catch (error) {
|
||||
console.error('Failed to send reset email:', error)
|
||||
throw createError({
|
||||
|
||||
@@ -89,7 +89,8 @@ export default defineEventHandler(async (event) => {
|
||||
bibleReferencesText,
|
||||
sermon.personal_appliance,
|
||||
sermon.pastors_challenge,
|
||||
userNotes
|
||||
userNotes,
|
||||
event
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user