Sandro
Sandro

Reputation: 9

TYPO3 Powermail Conditions

I have a form where the user has the option to subscribe to a newsletter (checkbox with the value 1). If that checkbox is clicked the email and name should be written to the fe_users table. Using the adapted example from the manual to write the fields into the fe_users table works fine as long as I do not have to check if the checkbox "newsletter" is clicked (https://github.com/einpraegsam/powermail/blob/8.4/Documentation/ForAdministrators/BestPractice/SendingValuesToThirdPartySoftware.md)

I tried to wrap the TypoScript in a traverse condition but then it does nothing. Without the condition, it works fine.

[traverse(request.getParsedBody(), 'tx_powermail_pi1/field/newsletter') == 1 ]
    plugin.tx_powermail.settings.setup {
        dbEntry {  
            1 {
                _enable = TEXT
                _enable {
                value = 1
                if.value = optinConfirm
                if.equals.data = GP:tx_powermail_pi1|action
                } 
                
                _table = TEXT
                _table.value = fe_users
                
                _ifUnique.email = update
                _ifUniqueWhereClause = AND pid = XXX
                
                email = TEXT
                email.field = e_mail
                
                pid = TEXT
                pid.value = XXX
                
                tstamp = TEXT
                tstamp.data = date:U
                
                username = TEXT
                username.field = nachname
                
                password = TEXT
                password.value = XXX
                
                usergroup = TEXT
                usergroup.value = XXX
            }
        }
    }

[END]

I am using TYPO3 10.4 and Powermail 8.4

Upvotes: 0

Views: 299

Answers (0)

Related Questions