update emails
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 5 Mar 2015 18:56:41 +0000 (13:56 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 5 Mar 2015 18:56:41 +0000 (13:56 -0500)
for confirmations
to goto the correct user who filled in form.

Toolkit/Contacts/ContactUs.php
Toolkit/Contacts/GolfGiveaway.php
Toolkit/Contacts/GreatBigGaylordGolfGetaway.php
Toolkit/Contacts/PassPort.php
Toolkit/Contacts/templates/passportConfEmail.tpl

index cb433e2..337bf6d 100755 (executable)
@@ -810,22 +810,11 @@ class Toolkit_Contacts_ContactUs
             $page->formData['cc_cvv'],
             $page->formData['captcha_rmv']
         );
-
+        $config    = parse_ini_file('config.ini', true);
+        $pass_type = $config['pass_type'];
         if ($this->elementExists('pass_type')) {
             $passType = filter_var($_POST['pass_type'], FILTER_VALIDATE_INT);
-            switch ($passType) {
-            case "89":
-                $page->formData['pass_type']['element'] = '$89.00 Internet Special';
-                break;
-            case "75":
-                $page->formData['pass_type']['element'] = '$75.00 AAA Member Special';
-                break;
-            default:
-                $page->formData['pass_type']['element'] = $passType;
-                break;
-            }
-//            var_dump($page->formData['pass_type']);
-//            exit;
+            $page->formData['pass_type']['element'] = $pass_type[$passType];
         }
 
         /* Boolean types */
@@ -914,6 +903,7 @@ class Toolkit_Contacts_ContactUs
      * @access protected
      */
     protected function sendConfirmation(
+        $email,
         $emailSubject,
         $emailTemplate,
         $mailFactory = 'mail'
@@ -929,6 +919,16 @@ class Toolkit_Contacts_ContactUs
         $page->fname       = $this->getSubmitValue('fname');
         $page->lname       = $this->getSubmitValue('lname');
 
+        if ($this->elementExists('qty')) {
+            $page->qty = $this->getSubmitValue('qty');
+        }
+        $config    = parse_ini_file('config.ini', true);
+        $pass_type = $config['pass_type'];
+        if ($this->elementExists('pass_type')) {
+            $passType = filter_var($_POST['pass_type'], FILTER_VALIDATE_INT);
+            $page->pass_type = $pass_type[$passType];
+        }
+
         $template->compile($emailTemplate);
         $htmlMsg = $template->bufferedOutputObject($page);
 
@@ -936,7 +936,7 @@ class Toolkit_Contacts_ContactUs
         $msg .= "From {$page->fname} {$page->lname}\n\n";
 
         $mimeMail = new Mail_mime("\n");
-        $mimeMail->setFrom("Gaylord Golf Mecca <".OWNER_EMAIL.">");
+        $mimeMail->setFrom("Gaylord Golf Mecca <".SERVER_FROM_EMAIL.">");
         $mimeMail->setSubject($emailSubject);
         $mimeMail->setHTMLBody($htmlMsg);
         $mimeMail->setTXTBody($msg);
@@ -946,7 +946,7 @@ class Toolkit_Contacts_ContactUs
         $setHeader['Reply-To'] = "Gaylord Golf Mecca <".OWNER_EMAIL.">";
         $headers = $mimeMail->headers($setHeader);
 
-        $res = $mail->send($this->email, $headers, $body);
+        $res = $mail->send($email, $headers, $body);
         if (PEAR::isError($res)) {
             return Toolkit_Common::handleError($res);
         } else {
index 75b5dc8..c8a04f8 100755 (executable)
@@ -435,9 +435,13 @@ class Toolkit_Contacts_GolfGiveaway
      */
     public function confirmation()
     {
-        $this->sendConfirmation(
-            'Gaylord Golf Giveaway', // Email Subject
-            'giveawayConfEmail.tpl' // Email Template File
-        );
+        $email = $this->getSubmitValue('email');
+        if (GLM_TOOLBOX::valid_email($email)) {
+            $this->sendConfirmation(
+                $email, // Email to
+                'Gaylord Golf Giveaway', // Email Subject
+                'giveawayConfEmail.tpl' // Email Template File
+            );
+        }
     }
 }
index d45518c..a5cfbc7 100755 (executable)
@@ -350,10 +350,14 @@ class Toolkit_Contacts_GreatBigGaylordGolfGetaway
      */
     public function confirmation()
     {
-        $this->sendConfirmation(
-            'Confirmation Gaylord America\'s Summer Golf Mecca', // Email Subject
-            'getawayConfEmail.tpl' // Email Template File
-        );
+        $email = $this->getSubmitValue('email');
+        if (GLM_TOOLBOX::valid_email($email)) {
+            $this->sendConfirmation(
+                $email, // Email to
+                'Confirmation Gaylord America\'s Summer Golf Mecca', // Email Subject
+                'getawayConfEmail.tpl' // Email Template File
+            );
+        }
     }
     //    }}}
 }
index 3fe3884..f5c8ad0 100755 (executable)
@@ -483,10 +483,14 @@ class Toolkit_Contacts_PassPort
      */
     public function confirmation()
     {
-        $this->sendConfirmation(
-            'Gaylord Golf Passport', // Email Subject
-            'passportConfEmail.tpl' // Email Template File
-        );
+        $email = $this->getSubmitValue('email');
+        if (GLM_TOOLBOX::valid_email($email)) {
+            $this->sendConfirmation(
+                $email, // Email to
+                'Gaylord Golf Passport', // Email Subject
+                'passportConfEmail.tpl' // Email Template File
+            );
+        }
     }
     //    }}}
     //    {{{    checkCvv()
@@ -637,6 +641,8 @@ class Toolkit_Contacts_PassPort
     //    }}}
     public function processData($values)
     {
+        return parent::processData($values);
+
         $res = parent::processData($values);
         if ($res) {
             $res2 = $this->processAuthNet($values);
index 1ee28ac..056a34d 100755 (executable)
@@ -17,7 +17,7 @@
                 <table cellspacing="1" cellpadding="5" border="0" bgcolor="#c0c0c0" width="400">
                 <tr><td>
                <p>Thank you for requesting a Golf Passport!</p>
-               <p>This is a confirmation of your order for ".$qty." ".$passport."(s)</p>
+               <p>This is a confirmation of your order for {qty} {pass_type}(s)</p>
                <p>A $3.00 shipping charge is added to your total.</p>
                </td></tr>
                </table>