forms - Typo3:编辑表单插件使用的电子邮件模板
问题描述
目前我正在使用 Typo3 中的基本表单插件制作联系表单。我把它全部设置好了,它工作正常并且符合预期。我唯一的问题是我收到的电子邮件看起来很糟糕。我的表单有 10 个不同的输入,它只是返回某种列表中的字段。
输出如下所示:
male
Test
123
test@test,de
1
虽然它应该看起来像这样:
Gender: male
Name: Test
Age: 123
E-Mail: test@test,de
Agreed to TOS: yes
我试图用谷歌搜索这个问题的解决方案,因为我认为为此创建一个模板并不难,但到目前为止我还没有找到任何对我有用的东西。
我在这里尝试过这个解决方案并阅读了提供的 github 示例,但我不知道如何将解决方案应用到我的项目中。我已将此代码实现到我的.yaml
文件中:
templateName: 'template.html'
templateRootPath:
20: 'EXT:extension/Resources/Private/Forms/Templates/'
但是,一旦我尝试提交表单,我就会收到一堆错误。我也不知道在模板文件本身中写什么,我试图复制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 表中。
推荐阅读
- php - 无法让 wordpress 停止制作额外的 HTML 部分?
- typescript - 在 Typescript 的模型中创建静态函数时找不到命名空间“mongoose”
- c# - 使用 Durable Functions 推送到服务总线的消息计数不可靠
- python - 如何从输入范围创建数组
- c++ - Minimum Window Substring
- python - Expected MyPy errors when using Generic class but none given
- node.js - Why am I getting data from the database slowly?
- vue.js - How to disable prefetch in VueJS PWA?
- mongodb - Mongodb Aggregation group, count and group
- html - CSS调整按钮大小