Updating the email part.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 18 May 2018 12:41:24 +0000 (08:41 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 18 May 2018 12:41:24 +0000 (08:41 -0400)
Need to use the php filter for the form values to use them.

models/admin/support/index.php
views/admin/support/index.html

index 724f512..2a18eab 100644 (file)
@@ -82,6 +82,8 @@ class GlmMembersAdmin_support_index // extends GlmDataLeadEntry
         $view           = 'index';
         $email_settings = false;
         $option         = false;
+        $support_name   = '';
+        $support_email  = '';
 
         if ( isset( $_REQUEST['option'] ) ) {
             $option = filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING );
@@ -100,14 +102,18 @@ class GlmMembersAdmin_support_index // extends GlmDataLeadEntry
             }
 
             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" .
@@ -136,7 +142,7 @@ class GlmMembersAdmin_support_index // extends GlmDataLeadEntry
                 }
 
                 wp_mail(
-                    $email.','.$values['email'],
+                    $email.','.$form_email,
                     'Support Form',
                     $msg,
                     $hdrs,
@@ -158,7 +164,9 @@ class GlmMembersAdmin_support_index // extends GlmDataLeadEntry
 
         // 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,
         );
 
 
index 36c4954..2a995d0 100644 (file)
@@ -88,7 +88,7 @@
                             Your Name:
                         </td>
                         <td>
-                            <input type="text" name="name" required />
+                            <input type="text" name="name" value="{$name}" required />
                         </td>
                     </tr>
                     <tr>
@@ -97,7 +97,7 @@
                             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>&nbsp;Upload&nbsp;a&nbsp;screenshot:
+                            Upload&nbsp;a&nbsp;screenshot:<br>
                             (1MB Max)
                         </td>
                         <td>