This is my plugin:
<?php
namespace Vendor\Module\Plugin;
use Magento\Email\Controller\Adminhtml\Email\Template\DefaultTemplate;
class MyPlugin
{
public function afterExecute(DefaultTemplate $template, $result)
{
$text = $template->getData('template_text');
$text .= '<p>Custom Text</p>';
$template->setData('template_text', $text);
}
}
Var dump works. Plugin executes, but I can't get why getData method is not found. Any suggestions?
get_class_methods
to check available methods for your$template
object.