如何在shopware 6中转储可用于电子邮件模板的变量,如果无法转储,在哪里可以找到它们。谢谢
发布于 2020-08-19 14:31:25
没有办法将这些变量转储到twig中。您可以查看实体定义,例如order:https://github.com/shopware/platform/blob/c5b78af033b1438e497e28ec7b10ab25cedb8a0d/src/Core/Checkout/Order/OrderDefinition.php
然后你可以检查链接的实体等等。
您可以转储邮件服务的send函数中的变量:https://github.com/shopware/platform/blob/cb9229240c111c70594bbe7e1a8b4f018162dc44/src/Core/Content/MailTemplate/Service/MailService.php#L109
发布于 2021-11-17 08:02:26
我知道现在已经很晚了,但如果其他人偶然发现了这一点,您可以按如下方式使用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();
}发布于 2021-04-30 18:51:22
使用MediaService并从那里转储它。所有数据都会出现在Symfony控制台的Debug下(如果你使用的是Git的开发环境)
https://stackoverflow.com/questions/63470158
复制相似问题