streamsend
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 29 Jul 2014 20:04:37 +0000 (16:04 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 29 Jul 2014 20:04:37 +0000 (16:04 -0400)
Setup streamsend
for Enews form
for price request form

Toolkit/Contacts/config.ini
Toolkit/LeadManager/Affiliates/StreamSend.php
config/application.ini
priceQuoteForm.inc

index 94d4e6f..0e86dcb 100644 (file)
@@ -12,3 +12,4 @@ sequence = "contact_id_seq"
 2 = "E-News"
 ;3 = "Travel Planner"
 ;4 = "Visitor Guide"
+5 = "Price Quote Request"
index 2dfc8a2..5511e04 100755 (executable)
@@ -80,7 +80,8 @@ class Toolkit_LeadManager_Affiliates_StreamSend
         'zip'          => 'postal-code',
         'phone'        => 'phone-number',
         'interest'     => 'interests',
-        'contact_type' => 'contact-type'
+        'contact_type' => 'contact-type',
+        'discovery'    => 'discover'
     );
 
     /**
index 82a3ce6..c52ea23 100644 (file)
@@ -18,15 +18,15 @@ contactdb.html_email = "ON"
 
 ; STREAM SEND API
 ; Turn on the streamsend module to use with our contact application
-contactdb.streamsend.application = Off
+contactdb.streamsend.application = On
 ; Login id for the streamsend account
-contactdb.streamsend.login = Off
+contactdb.streamsend.login = "eMbsokkI99j3"
 ; Transaction key for the streamsend account
-contactdb.streamsend.key = Off
+contactdb.streamsend.key = "kcWYnjLGygCUDfI0"
 ; Streamsend account name
-contactdb.streamsend.account_name = Off
+contactdb.streamsend.account_name = "Big Fore"
 ; Streamsend audience number
-contactdb.streamsend.audience = Off
+contactdb.streamsend.audience = 1
 
 ; CONSTANT CONTACT API
 ; Constant Contact forms
index 2e24d5f..d2812e4 100644 (file)
@@ -611,9 +611,9 @@ class ActionProcess extends HTML_QuickForm_Action
             if ($contact === false) {
                 $sql = "
                     INSERT INTO contact(pquote_create_date, fname, lname, address, city, state, zip, phone, alt_phone, email, mail_ok, arrival, departure, golfers, nongolfers,
-                    lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, comments, discover, partysize, pquote)
+                    lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, comments, discover, partysize, pquote, contact_type)
                     VALUES (now(), :fname, :lname, :addy, :city, :state, :zip, :phone, :altphone, :email, true, :arrival, :departure, :golfers, :nongolfers, :lodging,
-                           :couples, :singles, :brooms, :rooms, :beds, :twinok, :sofaok, :comments, :discover, :partysize, true)";
+                           :couples, :singles, :brooms, :rooms, :beds, :twinok, :sofaok, :comments, :discover, :partysize, true, ':5:')";
             } else {
                 $sql = "
                     UPDATE contact
@@ -643,7 +643,8 @@ class ActionProcess extends HTML_QuickForm_Action
                            comments = :comments,
                            discover = :discover,
                            partysize = :partysize,
-                           pquote= true
+                           pquote= true,
+                           contact_type = ':5:'
                      WHERE email = :email";
             }
 
@@ -679,6 +680,13 @@ class ActionProcess extends HTML_QuickForm_Action
             $stmt->bindParam(':partysize',  $partySize,             PDO::PARAM_INT);
             $stmt->execute();
 
+            // check if stream send is setup
+            if (defined('STREAMSEND_FORMS_API') && STREAMSEND_FORMS_API) {
+                // call the streamsends API to send contact to stream send
+                $streamSend = new Toolkit_LeadManager_Affiliates_StreamSend();
+                $streamSend->addContact($values);
+            }
+
             if ($contact === false) {
                 $sql = "
                     SELECT id