Add has-many relationship from emails to processing jobs

 New Feature:
- Add 'jobs' relationship field to emails collection
- Shows all PayloadCMS jobs associated with each email
- Read-only field with smart filtering by emailId
- Visible in admin interface for better email tracking

🔍 Benefits:
- Track job status and history for each email
- Debug processing issues more easily
- Monitor job queue performance per email
- Complete email processing visibility
This commit is contained in:
2025-09-14 20:41:19 +02:00
parent f5e04d33ba
commit 70fb79cca4
3 changed files with 35 additions and 9 deletions

View File

@@ -50,7 +50,7 @@ export async function processJobById(payload: Payload, jobId: string): Promise<v
}
})
} catch (error) {
throw new Error(`Failed to process job ${jobId}: ${error instanceof Error ? error.message : String(error)}`)
throw new Error(`Failed to process job ${jobId}: ${String(error)}`)
}
}