gpt4 book ai didi

typo3 - 发送TYPO3 EXT :powermail mail to different receivers depending on selection in a dropdown

转载 作者:行者123 更新时间:2023-12-04 23:16:18 25 4
gpt4 key购买 nike

我经常需要根据表单中选择字段的选择,向不同的接收者发送 super 邮件表单。
我正在使用TYPO3 7.6.x和Powermail 3.3.0
如何才能做到这一点?

最佳答案

在EXT:powermail的slackchannel中,在@ alex-kellner的帮助下,我找到了一个非常简单的解决方案:

基本上需要两个步骤:

步骤1

选择字段中“选项”的值。
您需要在选择字段中为选项添加值。这可以通过将管道|附加到您的选项并简单地添加值来完成

MyRecieverEmail 1 | 1

MyRecieverEmail 2 | 2

MyRecieverEmail 3 | 3

除此之外,您还需要知道字段的标记/变量/单个字段名。您可以在字段的 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

现在,您需要检查在表单中选择了wich选项。这是通过全局条件完成的:
[globalString = GP:tx_powermail_pi1|field|yourVariableFieldname = 1]

其中 yourVariableFieldname包含该字段中 extended选项卡中的各个字段名称,而 1是第一个选项的值(MyRecieverEmail 1)

通过使用此TS,如果在表单中选择了第一个选项 MyRecieverEmail 1,则该表单将发送到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]

现在,您可以根据需要添加任意数量的条件。完整的示例为:
[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]

请注意,这将由您的TYPO3-Install中考虑了此TS的每个字段名称为{yourVariableFieldname}的字段负责。
如果您以多种形式完全一样地使用此字段,这将很有用。
如果您不希望这样做,可以有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]

    关于typo3 - 发送TYPO3 EXT :powermail mail to different receivers depending on selection in a dropdown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41158364/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com