Merged
Conversation
Contributor
|
Great, thanks @cntabana! Added in v2.3.3. |
This was referenced Mar 19, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Summary:
The current implementation of the bulk resend action form in FilamentPHP does not correctly extract and pass email addresses (to, cc, bcc) from the selected records. Instead, the form opens without pre-filling these fields, requiring manual input.
What This PR Does:
This PR updates the ->form(fn ($records) => self::getBulkResendForm($records)) function to dynamically extract email addresses from the selected records and pass them into the form. This ensures that when the resend form modal appears, the recipient fields (to, cc, bcc) are pre-filled with unique email addresses from the selected records.
Changes & Fixes:
Extracts emails from selected records
Uses array_keys($record->to ?: []), array_keys($record->cc ?: []), and array_keys($record->bcc ?: []) to retrieve email addresses from JSON fields.
Ensures that even if some records do not have cc or bcc, it will not cause errors.
Code Implementation:
Why This Fix Is Important?
✅ Ensures recipient fields are auto-filled – No need for manual entry.
✅ Fixes the issue of empty form fields – The previous implementation did not correctly pass emails into the form.
✅ Makes the code more maintainable & efficient – Avoids unnecessary repetition when extracting email addresses.
✅ Enhances user experience – Users can now bulk resend emails without extra effort.