I am having troubles trying to use the checkboxes in a form to determine the recipient(s) of the email sent on submission. Best I can tell, it just doesn't work.
- I can do it if I use radio buttons, but that limits it to just one recipient.
- Does not work if i put the placeholder for either &emailTo or &emailCC
- If i manually set emailTo, the email comes through with the correct email addresses passed to the placeholder in the body of the email.
- Does not work if I select one checkbox or many
- When I set the placeholder for emailTo, the email appears to fail to send. CC and BCC emails are not received.
- Even if the email is not sent, formSave will still log the passed values, and the form successfully redirects
- Using formit 2.2.0 and modx 2.3.2
[[!FormIt?
&hooks=`spam,FormSave,email,redirect`
&emailTpl=`form-test-email`
&emailTo=`[[+hotels]]`
&emailCC=`[[*form-rfp-cc]]`
&emailSubject=`[[*form-rfp-subject]]`
&emailFrom=`website@[[++http_host]]`
&redirectTo=`8`
&fsFormTopic=`Meetings RFP Submission`
&validate=`
contact-name:required,
contact-email:required`
]]
<div class="form-third">
<label for="contact_email">Hotels: <small>(All that apply)</small></label>
<label class="check-label" for="hotel1">
<input type="checkbox" id="hotel1" name="hotels[]" value="[email protected]" />
DoubleTree
</label>
<label class="check-label" for="hotel2">
<input type="checkbox" id="hotel2" name="hotels[]" value="[email protected]" />
Hyatt Lodge
</label>
<label class="check-label" for="hotel3">
<input type="checkbox" id="hotel3" name="hotels[]" value="[email protected]" />
Marriott
</label>
<label class="check-label" for="hotel4">
<input type="checkbox" id="hotel4" name="hotels[]" value="[email protected]" />
Residence Inn
</label>
<label class="check-label" for="hotel5">
<input type="checkbox" id="hotel5" name="hotels[]" value="[email protected]" />
Le Méridien
</label>
</div>