kitzberger / form-mailtext
TYPO3 Form: 通过插件使用邮件文本
2.1.5
2023-09-26 18:49 UTC
Requires
- typo3/cms-core: ^10.4 || ^11.5 || ^12.4
- typo3/cms-form: ^10.4 || ^11.5 || ^12.4
Requires (Dev)
- rector/rector: ^0.12.9
README
此扩展通过添加一个名为 '邮件文本'(message)的新字段,增强了EXT:form的邮件结束器,允许编辑器在后台表单插件中定义邮件文本
重写EmailFinisher
为此,EXT:form的邮件结束器类被我们的EmailFinisher重写,以便将message
变量传递到模板Finishers/Email/Html.html,在那里它由RenderMessageViewHelper处理并渲染到所有创建的电子邮件中。
TypoScript
以下TS设置通过ext_typoscript_setup.typoscript自动添加
plugin.tx_form {
settings {
yamlConfigurations {
100 = EXT:form_mailtext/Configuration/Form/MailtextFormSetup.yaml
}
}
}
module.tx_form {
settings {
yamlConfigurations {
100 = EXT:form_mailtext/Configuration/Form/MailtextFormSetup.yaml
}
}
}
邮件文本
在邮件文本中,您可以使用输入字段的标识符输出任何用户输入,例如 {text-1}
。
此外,还有一个实验性功能,允许您使用if
等控制流
Hi {text-1},
you've selected {if:singleselect-1:=:}nothing{endif}{if:singleselect-1:=:1}apple{endif}{if:singleselect-1:=:2}orange{endif}{if:singleselect-1:=:3}banana{endif}.
And your other input is within an array: {if:multiselect-1:in:cat,dog,hamster}it's a pet{endif}
Apparently you like {if:selectsingle-1:=:1}bikes{else}walking{endif}
Good bye.