So what am I missing? eForm appears happy to use the snippet in the Form generation chunk, but wont parse the snippet in the report email chunk.
In fact there’s no happiness at all here and
it’s not eForm which is using either snippet. This is starting to become a common misunderstanding. EForm template chunks are only ever parsed for place holders that eForm can recognize, which currently are [+placeHolder+] tags for which the values are either come from the submitted form, the language files or from eForm events.
Embedded snippet calls or chunks in template chunks are left alone by eForm. That they appear "to work" is simply because the MODx document parser works recursively and will,
once eForm is finished, re-parse the resulting content for more chunks, snippets etcetera. So what you see in your browser is the result of MODx replacing your embedded snippets/chunks and not eForm. This recursive parsing after eForm only happens with "normal" documents, when things are output to the browser. With the email report chunk which doesn’t result directly in browser output (but instead creates the body of an email) this recursive parsing doesn’t happen and hence embedded snippets do not get called!
An example:
Suppose a form template like this:
<form id="myID">
<label>My Name</label>
<input type="text" name="myName" eform="Your Name::1:We need the correct name:#VALUE John Doe" />
<label>My Select</label>
<select name="mySelect"
[[myDynamicSelect? &min=`1` &max=`4`]]
</select>
</form>
And a document like this
<h3>Special Form<h3>
<p>Please fill in the form below, blah blah...</p>
[!eForm? &tpl=`myFormTemplate` &formid=`myID`!]
Step 1. MODx parses the document and finds and runs the eForm snippet.
Step 2. Eform loads and parses the form template. Once finished it returns the result to MODx. The result would look like this:
<h3>Special Form<h3>
<p>Please fill in the form below, blah blah...</p>
<form id="myID">
<label>My Name</label>
<input type="text" name="myName" />
<label>My Select</label>
<select name="mySelect"
[[myDynamicSelect? &min=`1` &max=`4`]]
</select>
</form>
Step 3. MODx parses the (resulting) document again and finds and runs the myDynamicSelect snippet.
Step 4. myDynamicSelect runs it’s code and returns the result to MODx. The result will now look like:
<h3>Special Form<h3>
<p>Please fill in the form below, blah blah...</p>
<form id="myID">
<label>My Name</label>
<input type="text" name="myName" />
<label>My Select</label>
<select name="mySelect"
<option vaue="1">One</option>
<option vaue="2">One</option>
<option vaue="3">One</option>
<option vaue="4">One</option>
</select>
</form>
Step 5. Document is send to the browser (after a bit more processing).
Step 6. You get the idea that all is hunky dory. Sadly this is not true. eForm as you can deduct from the above has no idea about the four <option> values as they were not in the form yet by the time eForm was run.
Step 7. The form is submitted with correct value, and the whole process starts again at step 1, except this time eForm parses the report template (at step 3) and sends the email, then discards the resulting report and returns to MODx with a "thank you" message (or something similar) Step 4 is never executed while the report template is active!
Sorry for the drawn out explanation but I hope this clarifies things a bit for you. To achieve what you want you’ll need to use eForm’s events. For some examples have a look in the documentation and browse through these forums...