0

If I change getUrl method of AbstractTemplate.php, how much effect on other template in Magento 2.1.12. I am doing this for redirect custom forgotpassword page in Angular frontend. Please tell me.

1 Answer 1

0

The simplest answer is if you change it in the abstract class, it'll affect every class that extends from that abstract class.

The class \Magento\Email\Model\AbstractTemplate is extended by three classes:

  • \Magento\Newsletter\Model\Template
  • \Magento\Email\Model\Template
  • \Magento\Email\Model\BackendTemplate

So it will affect any email template which uses those three instances.

Having said, I would council against modifying the abstract class.

Magento 2 provides much better options to modify functionality, e.g. Plugins. In the Magento 2 context, Plugins are methods which can be called before, during or after any method call where the method has public visibility.

That is a much more future-proof way of implementing your own custom logic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.