-
-
Notifications
You must be signed in to change notification settings - Fork 450
Allow to override admin email preview templates #5162
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds return type declarations and improves the extensibility of admin email preview templates by changing how default templates are retrieved.
- Added return type declaration (
: array) togetTemplateOptions()method - Modified template retrieval to use model instance instead of static call, allowing method override in custom modules
| public function getTemplateOptions(): array | ||
| { | ||
| return Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray(); | ||
| return Mage::getModel('core/email_template')->getDefaultTemplatesAsOptionsArray(); |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new model instance on every call to getTemplateOptions() is inefficient. Consider instantiating the model once and reusing it, or caching the result if the templates don't change frequently during a request.
|
Please add description. Not possible to rewrite Pls do not change signature for public methods. |
|
getTemplateOptions and getDefaultTemplatesAsOptionsArray are public methods. Why not rewrite them? P----------lease add some descrition what it is for. |
|



Description (*)
Add possibility to rewrite getDefaultTemplatesAsOptionsArray method
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)