我经常要求根据表单中选择的选择字段向不同的接收者发送powermail表单.我正在使用TYPO3 7.6.x和Powermail 3.3.0如何做到这一点?
在@ alex-kellner的帮助下,EXT:powermail的slackchannel我找到了一个非常简单的解决方案:
基本上需要2个步骤:
步骤1
选择字段中选项的值.您需要在选择字段中为选项添加值.这可以通过|在您的选项中附加管道并简单地添加值来完成
MyRecieverEmail 1 | 1
MyRecieverEmail 2 | 2
MyRecieverEmail 3 | 3
Run Code Online (Sandbox Code Playgroud)
除此之外,您还需要知道字段的标记/变量/单个字段名称.您可以在extended字段的选项卡中找到该名称.
如果需要,您还可以为此字段指定"自己的"变量名称.变量被包装{}但在步骤2中你不会这些
第2步
现在您需要在setupfield中添加一些TS.
背景信息:基本上这会更改表单的接收者:
plugin.tx_powermail.settings.setup.receiver.overwrite.email = TEXT
plugin.tx_powermail.settings.setup.receiver.overwrite.email.value = your@email.com
Run Code Online (Sandbox Code Playgroud)
现在您需要检查表单中选择的选项.这是通过全局条件完成的:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 1]
Run Code Online (Sandbox Code Playgroud)
yourVariableFieldname字段中extended选项卡中的单个字段名称在哪里,并且1是第一个选项的值(MyRecieverEmail 1)
如果MyRecieverEmail 1在表格中选择第一个选项,则使用此TS,表格将发送至your@email.com :
[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 = your@email.com
[global]
Run Code Online (Sandbox Code Playgroud)
您现在可以根据需要添加任意数量的条件.完整的例子是:
[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 = yourfirst@email.com
[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 = yoursecond@email.com
[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 = yourthird@email.com
[global]
Run Code Online (Sandbox Code Playgroud)
请注意,这将在您的TYPO3-Install中使用字段名{yourVariableFieldname}的每个字段负责,其中考虑了此TS.如果您在多个表单中使用与此字段完全相同的字段,则此选项非常有用.如果您不希望这个负责,您有2个选项可以避免这种情况:
只将TS放在表单所在的页面上.
您可以将其添加到您的全局条件:
&& [globalString = GP:tx_powermail_pi1 | mail | form = 123]
123表格的ID 在哪里.
这将是这样的:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 2] && [globalString = GP:tx_powermail_pi1|mail|form = 123]
Run Code Online (Sandbox Code Playgroud)