Typo3 8.7:表单整理器 EmailToReceiver / EmailToSender 的不同邮件模板

ejo*_*joo 3 forms typo3 email-templates typo3-8.x

我使用 Typo3 表单模块 (sysext) 和两个电子邮件完成程序:EmailToReceiver 与 EmailToSender。我设置了自定义邮件模板,但是

  • 如何为这两封不同的邮件选择不同的邮件模板?
  • 或者还有其他方法可以发送两封不同的邮件吗?

seb*_*kln 6

除了 Mathias Brodala 的正确答案之外,您还可以在每个电子邮件完成器中使用templateNametemplateRootPathsoptions.format如果配置如下,它将尊重您设置的电子邮件格式:

finishers:
  -
    identifier: EmailToReceiver
    options:
      subject: 'E-Mail from website'
      recipientAddress: your.company@example.com
      recipientName: 'Your Company name'
      senderAddress: '{email}'
      senderName: '{lastname}'
      replyToAddress: ''
      carbonCopyAddress: ''
      blindCarbonCopyAddress: ''
      format: html
      attachUploads: 'true'
      templateName: '{@format}.html'
      templateRootPaths:
        20: 'EXT:your_extension/Resources/Private/Forms/Emails/Receiver/'
      translation:
        language: ''
  -
    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'
      templateName: '{@format}.html'
      templateRootPaths:
        20: 'EXT:your_extension/Resources/Private/Forms/Emails/Sender/'
Run Code Online (Sandbox Code Playgroud)

根据上面设置的文件路径,然后将模板保存在

  • your_extension/Resources/Private/Forms/Emails/Sender/
    Html.htmlPlaintext.html
  • your_extension/Resources/Private/Forms/Emails/Receiver/
    Html.htmlPlaintext.html

完整的教程可以在这里找到。

GitHub 上有一个可用的 TYPO3 扩展,其中包含多个示例表单,其中包括一个仅适用于发件人的带有自定义邮件模板的表单。