Forum

Thread tagged as: Forms

Perch Form Multiple recipients - Add extra email recipient

I am trying to add a second recipient to this code:

<perch:label for="recipient">To</perch:label>
<perch:input type="select" id="recipient" label="Recipient" options="
    <perch:repeater id="recipients" label="Recipients">
        <perch:content id="name" type="text" label="name" />|<perch:content id="email" type="text" label="e-mail" /><perch:if id="perch_item_index" match="neq" value="{perch_item_count}">,</perch:if>
    </perch:repeater>
" /

https://forum.grabaperch.com/forum/02-25-2015-sending-form-contents-to-different-recipients-based-on-field-selection-in-a-form

Any help much appreciated

Thyme Morris

Thyme Morris 0 points

  • 3 years ago

The two addresses would have to be strung together with a comma. Problem is, if you do that, it will register as another option in your select. So, the comma needs to be escaped like so:

<perch:input type="select" id="recipient" label="Recipient" options="<perch:repeater id="recipients" label="Recipients"><perch:content id="name" type="text" label="name" />|<perch:content id="email" type="text" label="e-mail" />\,<perch:content id="email2" type="text" label="e-mail recipients 2" /><perch:if id="perch_item_index" match="neq" value="{perch_item_count}">,</perch:if> </perch:repeater>" />

Perfect. Thanks