mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-11 08:43:24 +00:00
✨ Enhanced Job Relationship Management: - Use beforeChange to populate existing jobs in relationship field - Use afterChange to create new jobs and add them to relationship - Jobs now appear immediately in the relationship field - Better handling of updates vs new document creation 🔄 Hook Flow: 1. beforeChange: Find existing jobs for updates and populate relationship 2. afterChange: Create missing jobs and update relationship field 3. Result: Jobs relationship is always populated correctly 📈 Benefits: - Immediate job visibility in admin interface - No reliance on dynamic filtering alone - Proper relationship data in database - Handles both new emails and status changes - Prevents duplicate job creation