b13/form-custom-templates

启用使用TYPO3表单框架邮件结束器发送的电子邮件的自定义模板

安装数量: 6,507

依赖项: 0

建议者: 0

安全: 0

星标: 3

关注者: 8

分支: 1

公开问题: 3

类型:typo3-cms-extension

2.0.0 2024-02-16 09:27 UTC

README

允许用户为每个邮件结束器定义电子邮件模板,并在插件设置中覆盖它。

默认情况下使用全局定义的模板。需要配置额外的模板!

安装

composer req b13/form-custom-templates

配置

Doktype 和 typeNum

如果当前TYPO3实例中已经使用了doktype(默认:125)或typeNum(默认:101),则可以在设置 -> 扩展配置中更改这两个值。常量plugin.tx_form_custom_templates.doktypeplugin.tx_form_custom_templates.typeNum将根据扩展配置中设置的值自动设置。

添加TypoScript配置

使用@importinclude_static_file添加基本配置。

@import 'EXT:form_custom_templates/Configuration/TypoScript/setup.typoscript'

这将扩展EmailToSenderEmailToReceiver结束器,并添加一个模板选择器。模板选择器将列出所有doktype Email(插件.tx_form_custom_templates.doktype默认:125)的页面。默认情况下,使用基于SystemEmail.html的模板的页面类型Email。

自定义HTML模板

[page["doktype"] == {$plugin.tx_form_custom_templates.doktype}]
    # Set the template
    page.10.templateName = SystemEmailTemplate

    # Use custom template paths
    page.10.templateRootPaths.20 = EXT:SITE_PACKAGE/Resources/Private/Frontend/Templates/
    page.10.partialRootPaths.20 = EXT:SITE_PACKAGE/Resources/Private/Frontend/Partials/
    page.10.layoutRootPaths.20 = EXT:SITE_PACKAGE/Resources/Private/Frontend/Layouts/
[END]

自定义结果列表模板

定义文件路径(省略后缀)。需要html和txt格式的模板。

plugin.tx_form_custom_templates.resultList.templatePath = EXT:form_custom_templates/Resources/Private/Frontend/Partials/ResultTable

定义默认模板

module.tx_form.settings.yamlConfigurations.555 = EXT:YOUR_SITE_PACKAGE/Configuration/Yaml/CustomTemplate.yaml
plugin.tx_form.settings.yamlConfigurations.555 = EXT:YOUR_SITE_PACKAGE/Configuration/Yaml/CustomTemplate.yaml
TYPO3:
  CMS:
    Form:
      prototypes:
        standard:
          finishersDefinition:
            EmailToSender:
              formEditor:
                predefinedDefaults:
                  options:
                    emailTemplateUid: '221'