Allow to override admin email preview templates#5162
Allow to override admin email preview templates#5162Tomasz-Silpion wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 (*)