powermail dynamic receivers based given number

108 Views Asked by At

The Task: User Types a number into field "x". The first 3 Digits are used to determine the receiver-mail.

What i have got so far:

plugin.tx_powermail.settings.setup.receiver.predefinedReceiver {
receiverstest.email = CASE
receiverstest.email {
    key.data = GP:tx_powermail_pi1|field|x
    key.stdWrap.crop = 3 | | 0

    001 = TEXT
    001.value = [email protected]

    002 = TEXT
    002.value = [email protected]

    default = TEXT
    default.value = [email protected]
}

}

The Problem: Powermail uses always the default mail. The Questions: What is my error here? How can it work?

Thank you!

2

There are 2 best solutions below

0
user3759978 On BEST ANSWER

Mystery solved: i forgot to set this in the page TSconfig:

tx_powermail.flexForm.predefinedReceivers.addFieldOptions.receiverstest = receivers #1

Thank you all for the help!

3
Julian Hofmann On

Syntax of crop is: [numbers of characters to keep] | [ellipsis] | [keep whole words] (-> TSref: stdWrap.crop)

So, the '1' of the last part of your snippet will keep whole words - exactly what you do not want in your case. A word, which would normally be cut in the middle, is removed completely => your TS will always fall in default-case.