Im trying to email a list of checkbox values using wp_mail
the result of my code IS sending the email
but the value returns as an array.. I understand why, but I am not sure how to breakdown the array, I dont see how I can implement a foreach here.
PHP:
//checkmarks post variable
$checks = $_POST['personalization_result'];
//php mailer variables
$to = get_option('admin_email');
$subject = "Someone sent a message from ".get_bloginfo('name');
$headers = 'From: '. $email . "rn" .
$sent = wp_mail($to, $subject, $checks, $headers);
HTML:
<form action="<?php the_permalink(); ?>" method="post">
<input type="hidden" name="submitted" value="1">
<input type="submit">
<li class="option table selected">
<div class="option-checkbox">
<input type="hidden" value="0" name="personalization_result[memory_0]">
<input type="checkbox" value="1" name="personalization_result[memory_0]" id="personalization_result_memory_0" checked="checked">
</div>
</div>
</li>
<li class="option table selected">
<div class="option-checkbox">
<input type="hidden" value="0" name="personalization_result[memory_1]">
<input type="checkbox" value="1" name="personalization_result[memory_1]" id="personalization_result_memory_1" checked="checked">
</div>
</div>
</li>
</form>