Formit dynamic emailTo not working

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.




// Form
<select name="recipient" id="recipient" required>

// teamEmailSelect tpl
<option value="[[+id]]" [[!+fi.recipient:default=`1`:FormItIsSelected=`[[+id]]`]]>[[+name]]</option>

// teamEmailAddress tpl

// teamEmailName tpl

Is it a problem to fill those values with migxLoopCollection? Outside the Formit call, those work just fine.

From the example you linked


it seems the semicolon ; is used to separate the email-addresses and not the comma.

Also in teamEmailSelect you may need to use the index instead of the id for the value.

Didn’t realize that, working great now!
Why is there a comma after the first entries though? Is that a mistake or syntax for something additional?

In the example, if you choose the first option in the <select>, it sends the mail to 2 different email-addresses. These 2 email-addresses are separated by a comma.

(It’s basically the same as the &emailTo property, where you also can define a comma-separated list of email-addresses.)

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.