$view = 'index';
$email_settings = false;
$option = false;
+ $support_name = '';
+ $support_email = '';
if ( isset( $_REQUEST['option'] ) ) {
$option = filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING );
}
if ($email) {
+ $form_name = filter_var( $_REQUEST['name'] );
+ $form_email = filter_var( $_REQUEST['email'] );
+ $form_problem = filter_var( $_REQUEST['problem'] );
+
// Setup the Headers.
$hdrs = 'From: '.$from_name.' <' . $from . '>';
- $hdrs .= "\nReply-To: {$values['name']} <{$values['email']}>";
+ $hdrs .= "\nReply-To: {$form_name} <{$form_email}>";
// Setup the message.
- $msg = 'Name: ' . $values['name'] . "\n" .
- 'Email: ' . $values['email'] . "\n" .
- 'Problem:' . stripslashes($values['problem']) . "\n\n\n" .
+ $msg = 'Name: ' . $form_name . "\n" .
+ 'Email: ' . $form_email . "\n" .
+ 'Problem:' . stripslashes($form_problem) . "\n\n\n" .
'SiteName: ' . get_bloginfo('name') . "\n" .
'SiteUrl: ' . get_bloginfo('url') . "\n" .
'Date: ' . date('m/d/Y') . "\n" .
}
wp_mail(
- $email.','.$values['email'],
+ $email.','.$form_email,
'Support Form',
$msg,
$hdrs,
// Common things to place into the $templateData array
$templateData = array(
- 'pluginAsset' => GLM_MEMBERS_SUPPORT_PLUGIN_URL . '/assets'
+ 'pluginAsset' => GLM_MEMBERS_SUPPORT_PLUGIN_URL . '/assets',
+ 'name' => $support_name,
+ 'email' => $support_email,
);
Your Name:
</td>
<td>
- <input type="text" name="name" required />
+ <input type="text" name="name" value="{$name}" required />
</td>
</tr>
<tr>
Your E-mail:
</td>
<td>
- <input type="email" name="email" required />
+ <input type="email" name="email" value="{$email}" required />
</td>
</tr>
<tr>
</tr>
<tr>
<td>
- <span class="req">*</span> Upload a screenshot:
+ Upload a screenshot:<br>
(1MB Max)
</td>
<td>