Exporter Email Notification

Is there a recommended best practice approach to sending an email notification on successful completion of an export of data? I've been trawling through the docs but everything only points towards database notifications. I would like to send an email notification, ideally on creation of the database notification. I'm currently planning to create a custom event listener which listens for the global Illuminate\Notifications\Events\NotificationSent event and then interrogate the data of every event this captures to ensure it is the correct "export" event to trigger a custom email notification to send to the user, but this feels clunky and a bit of an anti-pattern. Any recommendations for how to handle this would be super appreciated! πŸ™
3 Replies
toeknee
toekneeβ€’2w ago
If you are jobbing it... why not use: https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export#customizing-the-export-job and on the job completion send the notification?
Adapt.Patrick
Adapt.PatrickOPβ€’2w ago
Thanks @toeknee, I had somehow overlooked this in the docs. πŸ€¦β€β™‚οΈ I'll dig into this and let you know how I get on. I'll leave this thread "open" until I can confirm if I've been able to achieve my desired outcome. πŸ‘ Separately, @toeknee, do you know if this would enable us to customise the output of the export, too?
toeknee
toekneeβ€’2w ago
I've not tried it... but probably
Want results from more Discord servers?
Add your server