mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 12:11:17 -05:00
Fix: Use ADMIN_EMAIL_ADDRESS in reply function
This commit is contained in:
@@ -67,6 +67,9 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
}, 400, corsHeaders);
|
||||
}
|
||||
|
||||
// Get admin email from environment variable
|
||||
const adminEmail = Deno.env.get('ADMIN_EMAIL_ADDRESS') || 'admins@thrillwiki.com';
|
||||
|
||||
// Fetch admin's profile for signature
|
||||
const { data: adminProfile } = await supabase
|
||||
.from('profiles')
|
||||
@@ -144,7 +147,7 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
from: 'ThrillWiki Admin <admin@thrillwiki.com>',
|
||||
from: `ThrillWiki Admin <${adminEmail}>`,
|
||||
to: `${submission.name} <${submission.email}>`,
|
||||
subject: finalSubject,
|
||||
text: finalReplyBody,
|
||||
@@ -176,7 +179,7 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
message_id: messageId,
|
||||
in_reply_to: inReplyTo,
|
||||
reference_chain: [inReplyTo],
|
||||
from_email: 'admin@thrillwiki.com',
|
||||
from_email: adminEmail,
|
||||
to_email: submission.email,
|
||||
subject: finalSubject,
|
||||
body_text: finalReplyBody,
|
||||
|
||||
Reference in New Issue
Block a user