0

I use a powermail form and want to send the formdata to a third party script with this code.

plugin.tx_powermail.settings.setup {
marketing {
       sendPost {
        _enable = TEXT
        _enable.value = 1

        targetUrl = https://resource.de/dashboard/mail.php

        values = COA
        values {
            10 = TEXT
            10 {
                field = anrede
                wrap = &2=|
            }
            20 = TEXT
            20 {
                field = first_name
                wrap = &first_name=|                
            }   
            30 = TEXT
            30 {
                field = last_name
                wrap = &last_name=|
            }
            40 = TEXT
            40 {
                field = newsletter
                newletter
            }               
            50 = TEXT
            50 {
                field = ort
                wrap = &city=|
            }
            60 = TEXT
            60 {
                field = datenschutz
                wrap = &3=|
            }   
            70= TEXT
            70 {
                field = email
                wrap = &email=|             
            }                                                                                   
        }
    }
}

}

so long this works fine.

Now my problem: I only want to send this to the third party script when the field newsletter is true.

Or at least delete the field email when newsletter is false.

Is this possible?

thank you!

Daniel
  • 6,916
  • 2
  • 36
  • 47
seking
  • 35
  • 8

2 Answers2

0

The configuration _enable is of type cObject - and this can be used in different ways. E.g. if there is a GET/POST parameter: _enable = TEXT _enable.data = GP:tx_powermail_pi1|field|checkboxmarkername|0 This enables/disables the complete function.

Alex Kellner
  • 1,263
  • 6
  • 11
0

You can use TYPO3 Condition like this.

[globalVar = GP:tx_powermail_pi1|newsletter = 1]

 plugin.tx_powermail.settings.setup {
     marketing {
       sendPost {
        _enable = TEXT
        _enable.value = 1
        .........
        .........
        .........
[global]

 plugin.tx_powermail.settings.setup {
     marketing {
       sendPost {
        _enable = TEXT
        _enable.value = 1
        .........
        .........
        .........
        _ifUnique.email = update
        email = TEXT
        email.value =  
[end]
Pravin Vavadiya
  • 3,195
  • 1
  • 17
  • 34