Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Email model changeable from config #36

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

Jacobtims
Copy link
Contributor

This pull request makes the Email model configurable via the config/filament-email.php config file.
This allows users to override the Email model used by the package.

@Jacobtims
Copy link
Contributor Author

Fixes #30

Copy link

what-the-diff bot commented Feb 1, 2024

🎉 PR Summary 🎉

Hello there! Here's a simple summation of the changes we've made:

  • Configurable Email Model Update: 💌 Now, the RickDBCN\FilamentEmail\Models\Email model can be found in your config/filament-email.php config file. This increases flexibility on how and where this model is utilized across your project.
  • Factory and Resource Class Fun: 🏭 The EmailFactory and EmailResource classes underwent changes for better functioning! These classes now dynamically pull the Email model from our config file or if not found, they'll rely on our default RickDBCN\FilamentEmail\Models\Email 😊.
  • Record Variable Update: 📝 For ease, the $record parameter found in EmailResource class was updated to a generic type. Same for the resend method!
  • Logger Class Enhancements: 📚 The FilamentEmailLogger class has a new 'model' variable which fetches the model from the config (or defaults to RickDBCN\FilamentEmail\Models\Email as a failsafe). This plays a key role when creating new instances.
  • ResendMail and Test Updates: 📬🧪 The $email parameter in ResendMail class is now of a generic type — ensuing better adaptability. Plus, the EmailModelTest file got spicier with a beforeEach hook to fetch our model. This makes the test cases even smarter!

All in all, these changes flex up elements of autonomy and efficiency in our code — ensuring it dances smoothly to the rhythm of your project's needs. Enjoy the updated harmony! 🎶🤩

@RickDBCN
Copy link
Owner

RickDBCN commented Feb 2, 2024

Looks good to me! Thanks! :)

@RickDBCN RickDBCN merged commit 245fa65 into RickDBCN:main Feb 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants