Last active
December 30, 2015 22:06
-
-
Save benjaminrau/6341998 to your computer and use it in GitHub Desktop.
Dynamic recipients for powermail with powermail field defined via typscript and fallback for recipient when no recipient is defined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a Hidden Form Field named recipient | |
Define Recipient Email as: {f:cObject(typoscriptObjectPath:'lib.receiveremail')} | |
Define Recipient Name as: {f:cObject(typoscriptObjectPath:'lib.receivername')} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin.tx_clocations { | |
settings { | |
# cat=plugin.tx_clocations//a; type=string; label=Contact Form PID | |
contactFormPid = | |
# cat=plugin.tx_clocations//a; type=string; label=Contact Form Reciever Field ID | |
contactFormReceiverFid = | |
} | |
} | |
temp.contactFormReceiver = GP:tx_powermail_pi1|field|{$plugin.tx_clocations.settings.contactFormReceiverFid} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[globalVar = TSFE:id = {$plugin.tx_clocations.settings.contactFormPid}] | |
page.config.no_cache = 1 | |
[globalVar = {$temp.contactFormReceiver} != 0] | |
lib.receivername = CONTENT | |
lib.receivername { | |
table = tx_clocations_domain_model_contact | |
select.selectFields = fullname | |
select.pidInList={$plugin.tx_clocations.persistence.storagePid} | |
select.where.data = GP:tx_powermail_pi1|field|{$plugin.tx_clocations.settings.contactFormReceiverFid} | |
select.where.wrap = deleted=0 AND hidden=0 AND uid=| | |
select.where.intval = 1 | |
renderObj = TEXT | |
renderObj.field = fullname | |
} | |
lib.receiveremail = CONTENT | |
lib.receiveremail { | |
table = tx_clocations_domain_model_contact | |
select.selectFields = email | |
select.pidInList={$plugin.tx_clocations.persistence.storagePid} | |
select.where.data = GP:tx_powermail_pi1|field|{$plugin.tx_clocations.settings.contactFormReceiverFid} | |
select.where.wrap = deleted=0 AND hidden=0 AND uid=| | |
select.where.intval = 1 | |
renderObj = TEXT | |
renderObj.field = email | |
} | |
[else] | |
lib.receiveremail = TEXT | |
lib.receiveremail.value = [email protected] | |
lib.receivername = TEXT | |
lib.receivername.value = Codearts | |
[global] | |
[global] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I just found your code and I'm wondering where to find the extension tx_clocations.
Regards
Hobokens