首页 > 解决方案 > shopware 6 中的电子邮件模板变量

问题描述

如何在 shopware 6 中转储可用于我的电子邮件模板的变量,如果无法转储它们,我在哪里可以找到它们。谢谢

标签: shopwareshopware6

解决方案


我知道它很晚,但如果其他人偶然发现这一点,你可以使用MailBeforeValidateEvent如下:

    public static function getSubscribedEvents()
    {
        return [
            MailBeforeValidateEvent::class => 'mailValidate'
        ];
    }

    public function mailValidate(MailBeforeValidateEvent $event): void
    {
        // Here you get the template data
        $templateData = $event->getTemplateData();

        // Here you get the data
        $data = $event->getData();
    }

推荐阅读