在 EXT:powermail 的 slackchannel 中 @alex-kellner 的帮助下,我找到了一个非常简单的解决方案:
基本上需要 2 个步骤:
Step1
选择字段中选项的值。
您需要将值添加到选择字段中的选项。这可以通过附加管道来完成|
添加到您的选项并简单地添加值
MyRecieverEmail 1 | 1
MyRecieverEmail 2 | 2
MyRecieverEmail 3 | 3
除此之外,您还需要知道字段的标记/变量/单个字段名称。您可以在以下位置找到该名称extended
您所在领域的选项卡。
如果需要,您还可以为该字段指定一个“自己的”变量名称。该变量被包裹起来{}
但你不会在第 2 步中看到这些
Step 2
现在您需要在设置字段中添加一些 TS。
背景信息:基本上这会改变表单的接收者:
plugin.tx_powermail.settings.setup.receiver.overwrite.email = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.email.value = [email protected] /cdn-cgi/l/email-protection
现在您需要检查在表单中选择了哪个选项。这是通过全局条件完成的:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 1]
Where yourVariableFieldname
列出单个字段名称extended
字段中的选项卡和1
是第一个选项的值 (MyRecieverEmail 1)
通过使用此 TS,表格将发送至[电子邮件受保护] /cdn-cgi/l/email-protection如果第一个选项MyRecieverEmail 1
以以下形式选择:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 1]
plugin.tx_powermail.settings.setup.receiver.overwrite.email = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.email.value = [email protected] /cdn-cgi/l/email-protection
[global]
您现在可以根据需要添加任意数量的条件。完整的例子是:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 1]
plugin.tx_powermail.settings.setup.receiver.overwrite.email = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.email.value = [email protected] /cdn-cgi/l/email-protection
[global]
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 2]
plugin.tx_powermail.settings.setup.receiver.overwrite.email = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.email.value = [email protected] /cdn-cgi/l/email-protection
[global]
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 3]
plugin.tx_powermail.settings.setup.receiver.overwrite.email = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.email.value = [email protected] /cdn-cgi/l/email-protection
[global]
请注意,这将负责 TYPO3-Install 中考虑此 TS 的每个字段名称为 {yourVariableFieldname} 的字段。
如果您在多种表单中完全像这样使用此字段,这会很有用。
如果您不想让它负责,您有两种选择来避免这种情况:
仅将 TS 放置在表单所在的页面上。
-
您可以将其添加到您的全局条件中:
&& [globalString = GP:tx_powermail_pi1|邮件|表单 = 123]
Where 123
是您的表单的 ID。
这看起来像这样:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 2] && [globalString = GP:tx_powermail_pi1|mail|form = 123]