mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 05:51:12 -05:00
Fix thread ID matching for email replies
This commit is contained in:
@@ -232,6 +232,13 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
}
|
||||
});
|
||||
|
||||
// Update thread_id with Message-ID format (always, not just when email is sent)
|
||||
const threadId = `${ticketNumber}.${submission.id}`;
|
||||
await supabase
|
||||
.from('contact_submissions')
|
||||
.update({ thread_id: threadId })
|
||||
.eq('id', submission.id);
|
||||
|
||||
if (forwardEmailKey) {
|
||||
// Send admin notification
|
||||
fetch('https://api.forwardemail.net/v1/emails', {
|
||||
@@ -302,12 +309,6 @@ The ThrillWiki Team`,
|
||||
}).catch(err => {
|
||||
edgeLogger.error('Failed to send confirmation email', { requestId, error: err.message });
|
||||
});
|
||||
|
||||
// Update thread_id with ticket number
|
||||
await supabase
|
||||
.from('contact_submissions')
|
||||
.update({ thread_id: `ticket-${ticketNumber}` })
|
||||
.eq('id', submission.id);
|
||||
}
|
||||
|
||||
const duration = Date.now() - startTime;
|
||||
|
||||
Reference in New Issue
Block a user