F
Filament6mo ago
jey

send an email after creating a record

as title says , i want to send an email after creating a record , for example after creating a user via filament admin panel i want to notify the user via email about his new account ( simple example and similar to what i need )
7 Replies
icolatsi22
icolatsi226mo ago
you can use filament's Lifecycle hooks or laravel's model event hooks, like created() methods. So after your model is created you can do whatever. There's other methods too
jey
jeyOP6mo ago
thanks , however in the docs it doesn't show how we can access the created record no ?
toeknee
toeknee6mo ago
Just use a Laravel Observer, then in the created method send the email, you have the record then too.
jey
jeyOP6mo ago
$this->record
LeandroFerreira
LeandroFerreira6mo ago
yep
jey
jeyOP6mo ago
much appreciated marked as solved
Want results from more Discord servers?
Add your server