I tried the following:
a snippet named: eFormEvenFetchMailadr
<?php
function fetchEmailadr (&$fields)
{
global $modx;
$fields["email"] = $modx->getPlaceholder("email");
return true;
}
//return empty string
?>
The call:
[[eFormEvenFetchMailadr]]
[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`
[email protected]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`assets/templates/css/Form.css` &gotoid=`46` &vericode=`1` &eFormOnBeforeFormMerge=`fetchEmailadr` !]
The result:
The snippet doesn’t return any value (email, username, ...) but text ("hello" instead of $modx->getPlaceholder("email"))
Where is the mistake? Or is annother way more convenient?
As result of all, I want the email adr as &to parameter (or as value to an appropriate input field in the form template.