From: Steve Sutton Date: Tue, 29 Jul 2014 20:04:37 +0000 (-0400) Subject: streamsend X-Git-Tag: v1.1.0^2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=341a4b208caf18e3e4f4fe1ba7da6e4f11eeee3a;p=web%2FBigFore.git streamsend Setup streamsend for Enews form for price request form --- diff --git a/Toolkit/Contacts/config.ini b/Toolkit/Contacts/config.ini index 94d4e6f..0e86dcb 100644 --- a/Toolkit/Contacts/config.ini +++ b/Toolkit/Contacts/config.ini @@ -12,3 +12,4 @@ sequence = "contact_id_seq" 2 = "E-News" ;3 = "Travel Planner" ;4 = "Visitor Guide" +5 = "Price Quote Request" diff --git a/Toolkit/LeadManager/Affiliates/StreamSend.php b/Toolkit/LeadManager/Affiliates/StreamSend.php index 2dfc8a2..5511e04 100755 --- a/Toolkit/LeadManager/Affiliates/StreamSend.php +++ b/Toolkit/LeadManager/Affiliates/StreamSend.php @@ -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' ); /** diff --git a/config/application.ini b/config/application.ini index 82a3ce6..c52ea23 100644 --- a/config/application.ini +++ b/config/application.ini @@ -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 diff --git a/priceQuoteForm.inc b/priceQuoteForm.inc index 2e24d5f..d2812e4 100644 --- a/priceQuoteForm.inc +++ b/priceQuoteForm.inc @@ -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