DEPRECATION WARNING

This documentation is not using the current rendering mechanism and will be deleted by December 31st, 2020. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

In some case it could be useful, that the email receiver should be chosen by a selectfield value. E.g. if the visitor selects “receiver A” in a dropdown, powermail should use receivera@domain.org and in all other cases receiverb@domain.org

You can add a new option to the predefined receiver with a bit of page TSConfig

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


### Small example¶

In a simple example rec1@domain.org and rec2@domain.org should be always used, if the editor chooses “receivers2” in the plugin dropdown:

plugin.tx_powermail.settings.setup.receiver.predefinedReceiver {
}


### Dynamic example 1¶

In a bit more advanced example, we want to choose the receiver by a given value (e.g. of a select box). If value 1 is given in a field with marker {receiver}, receivera@domain.org should be chosen and if value 2 or something else is given, receiverb@domain.org should be chosen. See following TypoScript setup example:

plugin.tx_powermail.settings.setup.receiver.predefinedReceiver {

1 = TEXT

default = TEXT
}
}


### Dynamic example 2¶

Here is another advanced example how to set a different email address for the receiver, by changing an integer into a frontend user email address (get it from database fe_users.email by given fe_users.uid). We just use some lines of TypoScript with cObject CONTENT (example for TYPO3 8). See following TypoScript setup example:

# Get Email address from fe_users by given POST-parameter
table = fe_users
select {
# Page with fe_users records
pidInList = 33

where {
# UID of the fe_users record is given in field with marker {receiver}

wrap = uid=|
intval = 1
}
}
renderObj = TEXT
renderObj {
field = email
}
}