Do all dynamic data fields in Bricks support the {echo:} function? It seems the form “Send to” field in the form element does not seem to support it.
I am trying to create a custom contact form that sends emails to a hidden email address taken from a function in functions.php. The function takes a value from the URL parameter “sendto” and simply returns the correct email for the form to send the email to.
The function works well if I use it anywhere else on the page, but when trying to set the “Send to custom email address” field to {echo:get_hidden_email()} it doesn’t parse the function. I got it working by setting the value of a hidden field to this function result and then grab it by field ID - but the email address is still in the HTML of the page which I need to avoid.
function get_hidden_email() {
$sendto=bricks_render_dynamic_data('{url_parameter:sendto}');
if($sendto == 'secr') {
return 'secret-email@gmail.com';
} else {
return 'default@gmail.com';
}
}