I followed this part in the docs on Specifying Dynamic To Addresses from a select input, but it doesn’t seem to work. Formit comes back with an error, telling me to specify atleast one recipient, so my guess is the emailTo
is not properly set.
[[!FormIt?
&hooks=`spam,email`
&emailSelectTo=`
[[!migxLoopCollection?
&packageName=`team`
&classname=`Team`
&tpl=`teamEmailAddress`
&outputSeparator=`,`]]`
&emailSelectToName=`
[[!migxLoopCollection?
&packageName=`team`
&classname=`Team`
&tpl=`teamEmailName`
&outputSeparator=`,`]]`
&emailSelectField=`recipient`
&emailTpl=`email`
&emailFrom=`name@email.com`
]]
// Form
<select name="recipient" id="recipient" required>
[[migxLoopCollection?
&packageName=`team`
&classname=`Team`
&tpl=`teamEmailSelect`]]
</select>
// teamEmailSelect tpl
<option value="[[+id]]" [[!+fi.recipient:default=`1`:FormItIsSelected=`[[+id]]`]]>[[+name]]</option>
// teamEmailAddress tpl
[[+email]]
// teamEmailName tpl
[[+name]]
Is it a problem to fill those values with migxLoopCollection
? Outside the Formit call, those work just fine.