Forms Typo3:编辑表单插件使用的电子邮件模板
目前我正在使用Typo3中的基本表单插件开发一个联系人表单。我把一切都准备好了,一切正常。我唯一的问题是,我收到的电子邮件看起来很糟糕。我的表单有10个不同的输入,它只是返回某种列表中的字段 输出如下所示:Forms Typo3:编辑表单插件使用的电子邮件模板,forms,typo3,typo3-extensions,Forms,Typo3,Typo3 Extensions,目前我正在使用Typo3中的基本表单插件开发一个联系人表单。我把一切都准备好了,一切正常。我唯一的问题是,我收到的电子邮件看起来很糟糕。我的表单有10个不同的输入,它只是返回某种列表中的字段 输出如下所示: male Test 123 test@test,de 1 虽然它应该是这样的: Gender: male Name: Test Age: 123 E-Mail: test@test,de Agreed to TOS: yes 我曾尝试在谷歌上搜索这个问题的解
male
Test
123
test@test,de
1
虽然它应该是这样的:
Gender: male
Name: Test
Age: 123
E-Mail: test@test,de
Agreed to TOS: yes
我曾尝试在谷歌上搜索这个问题的解决方案,因为我觉得为这个问题创建一个模板并不难,但到目前为止,我还没有找到任何适合我的方法
我已经在这里尝试了解决方案,并通读了提供的github示例,但我不知道如何将该解决方案应用到我的项目中。我已经在.yaml文件中实现了以下代码:
但是,当我试图提交表单时,我得到了一大堆错误。我也不知道该在模板文件本身中写什么,我试着只是复制,但不知何故,我的代码甚至找不到我的模板文件
有人知道这个问题的解决办法吗 在YAML中,缩进用于指示嵌套配置的结构。因此,您需要确保每个设置都缩进正确 templateName和TemplateRootPath都是EXT:form中电子邮件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表中。会出现哪些错误?缩进在YAML中很重要–templateName:和TemplateRootPath:缩进是否相等?还请检查选项名称是否正确TemplateRootPath必须为复数!是否已使用此处所述的文件end.form.yaml?很抱歉回复太晚,今天没有时间访问我的电脑。我上面描述的实际问题很容易解决,完全是我的错:D我只需要在后端为每个输入设置标签,就得到了我想要的结果。尽管不太好,但它现在仍然可以工作。我很确定你对我的模板文件@sebkln的问题是正确的。不幸的是,我现在不能测试它,但我会在我的下一个项目。仅供参考:templateName:和TemplateRootPath:的缩进不相等。这可能是它还不起作用的原因吗?
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/'