F
Filament14mo ago
Xiquita

Send mail for other customer

Hello I have a question, I am sending an email that notifies when a customer is deleted, I send it to the user who is authenticated but how do I also send it to the email address of the customer who was deleted? Thanks
No description
Solution:
Not what i meant.
->before(function (DeleteAction $action, Model $record) {...})
->before(function (DeleteAction $action, Model $record) {...})
...
Jump to solution
5 Replies
bwurtz999
bwurtz99914mo ago
Do you have a form where the authenticated user selects the user they want to delete? If you do, you can use function (DeleteAction $action, array $data) and the access $data['user_id'] or however you identify them Or if this is a table delete action, you can use function ($record) and $record will have the data from that row in the table
Salah Kanjo
Salah Kanjo14mo ago
Add Model $record as argument to the function Which will resolve the current model which you ran the action on
Xiquita
XiquitaOP14mo ago
I have this now
No description
Xiquita
XiquitaOP14mo ago
Send mail to auth and other mail to all users
Solution
Salah Kanjo
Salah Kanjo14mo ago
Not what i meant.
->before(function (DeleteAction $action, Model $record) {...})
->before(function (DeleteAction $action, Model $record) {...})
Want results from more Discord servers?
Add your server