I am using wordpress and have created a list of users which are all links. Once clicked I need to carry the person email address over to a form where you can send an email to them directly. So it automatically populates to send with their email address. Currently I have looped through the users I want to send to but stuck on where to go from here:
<?php
$args1 = array(
'role' => 'committee',
'orderby' => 'user_nicename',
'order' => 'ASC'
);
$committee = get_users($args1);
foreach ($committee as $user) {
echo '
<a href="../contact-form?email=' . $user->user_email . '"><b style="font-size:18px;">
<tr>
<td style="padding: 10px;">' .$user->job_title .' - </td>
<td style="padding: 10px;">' .$user->display_name .'</td>
</tr></b></a><br><br>';
}
?>
I then need to send the persons email address who the user clicked on to this send page:
<form role="form" method="post" action="">
<div class="form-group">
<label for="InputName">Your name</label>
<input type="name" class="form-control" id="InputName" placeholder="Enter your name">
</div>
<div class="form-group">
<label for="InputEmail">Email address</label>
<input type="email" class="form-control" id="InputEmail" placeholder="you@example.com">
</div>
<div class="form-group">
<label for="InputMsg">Message</label>
<textarea class="form-control" rows="8" id="InputMsg" placeholder="Please begin typing your message..."></textarea>
</div>
<button type="submit" class="btn btn-primary pull-right">Send</button>
</form>
So if you click on a persons name it will take the user to a new page with a contact form, the person who they clicked on will then receive an email once the form is submitted. I just need some advice really on where to begin?