GenericEmail not found
I'm using
according to https://filamentphp.com/docs/3.x/actions/overview#what-is-an-action
but I'm seeing an error message "Class "App\Filament\App\Resources\GenericEmail" not found", where can I find GenericEmail?
8 Replies
Did you have the GenericEmail class?
…no, I don’t see the documentation mentioning it
What should the class include if I may ask?
this particular error is because you are not importing the class at the top of your file.
use App\Resources\GenericEmail;
That assumes that you actually have that class at that path. GenericEmail is something custom, so we don't know anything about where it is stored in your app or if it even exists in your app.This is just an example. You have to create a mailable class and replace the GenericEmail class with yours. You must go through Laravel mail documentation first and use mailable command to generate your class, write email body code and view. check this: https://laravel.com/docs/10.x/mail
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
BTW you can also check my implementation in how I use this mailable in my filament code.
And then create a mailable class like I created in app\mail\BuyInquiryEmail.php using command . I have also attached below code for generated BuyerInquiryEmail class.
BuyerInquiryEmail mailable class
then create view file for your email body. in mailable class path for view blade file is generated. Mine is 'emails.buyer-inquiry-email' in resource/view/emails.
Hope it helps.
You can create as many mailables classes based on. how many different emails and its templates you need. Mine is one such which gets triggered when a buyer sends and inquiry email to a seller. When admin approves then email is sent to seller.
I see, big thanks for your help Samir