Typo3:编辑表单插件使用的电子邮件模板
Typo3: Edit the E-Mail template used by the form plugin
目前我正在使用 Typo3 中的基本表单插件开发联系表单。我把它全部设置好了,它工作正常,符合预期。我唯一的问题是我收到的电子邮件看起来很糟糕。我的表单有 10 个不同的输入,它只是 return 某种列表中的字段。
输出如下所示:
male
Test
123
test@test,de
1
虽然它应该看起来像这样:
Gender: male
Name: Test
Age: 123
E-Mail: test@test,de
Agreed to TOS: yes
我已经尝试 google 来解决这个问题,因为我认为为此创建一个模板并不难,但到目前为止我还没有找到任何有效的方法为了我。
我已经在此处尝试了 this 解决方案并通读了提供的 github 示例,但我不知道如何将解决方案应用到我的项目中。我已将这段代码应用到我的 .yaml
文件中:
templateName: 'template.html'
templateRootPath:
20: 'EXT:extension/Resources/Private/Forms/Templates/'
但是当我尝试提交表单时,我收到了一堆错误。我也不知道在模板文件中写什么,我试图只复制 what's provided in the github 但不知何故我的代码甚至找不到我的模板文件。
有人知道这个问题的解决方案吗?
在 YAML 中,缩进用于表示嵌套(您的配置结构)。因此,您需要确保每个设置都正确缩进。
templateName
和 templateRootPaths
都是 EXT:form:
中 email finisher 的相等选项
finishers:
-
identifier: EmailToSender
options:
subject: 'Your message'
recipientAddress: '{email}'
recipientName: '{lastname}'
senderAddress: your.company@example.com
senderName: 'Your Company name'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
# The following part enables us to use the customized template:
templateName: '{@format}.html'
templateRootPaths:
20: 'EXT:form_examples/Resources/Private/Forms/CustomHtmlMailExample/Sender/'
您自己已经知道,表单标签将呈现在 TYPO3 表单框架的默认电子邮件模板中。如果在表单定义中设置了标签,标签和表单值将以简单的 HTML table 呈现。
目前我正在使用 Typo3 中的基本表单插件开发联系表单。我把它全部设置好了,它工作正常,符合预期。我唯一的问题是我收到的电子邮件看起来很糟糕。我的表单有 10 个不同的输入,它只是 return 某种列表中的字段。
输出如下所示:
male
Test
123
test@test,de
1
虽然它应该看起来像这样:
Gender: male
Name: Test
Age: 123
E-Mail: test@test,de
Agreed to TOS: yes
我已经尝试 google 来解决这个问题,因为我认为为此创建一个模板并不难,但到目前为止我还没有找到任何有效的方法为了我。
我已经在此处尝试了 this 解决方案并通读了提供的 github 示例,但我不知道如何将解决方案应用到我的项目中。我已将这段代码应用到我的 .yaml
文件中:
templateName: 'template.html'
templateRootPath:
20: 'EXT:extension/Resources/Private/Forms/Templates/'
但是当我尝试提交表单时,我收到了一堆错误。我也不知道在模板文件中写什么,我试图只复制 what's provided in the github 但不知何故我的代码甚至找不到我的模板文件。
有人知道这个问题的解决方案吗?
在 YAML 中,缩进用于表示嵌套(您的配置结构)。因此,您需要确保每个设置都正确缩进。
templateName
和 templateRootPaths
都是 EXT:form:
finishers:
-
identifier: EmailToSender
options:
subject: 'Your message'
recipientAddress: '{email}'
recipientName: '{lastname}'
senderAddress: your.company@example.com
senderName: 'Your Company name'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
# The following part enables us to use the customized template:
templateName: '{@format}.html'
templateRootPaths:
20: 'EXT:form_examples/Resources/Private/Forms/CustomHtmlMailExample/Sender/'
您自己已经知道,表单标签将呈现在 TYPO3 表单框架的默认电子邮件模板中。如果在表单定义中设置了标签,标签和表单值将以简单的 HTML table 呈现。