Current Path :
/
home
/
zrcdevco
/
public_html
/
medrio
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/zrcdevco/public_html/medrio/test_functions.php
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(~0); set_time_limit(0); date_default_timezone_set("America/New_York"); include 'hubspot_functions.php'; // Production Authentication Header //$authorization = "Authorization: Bearer pat-na1-4d0456ec-772d-4a2a-b16b-3f9a5fe3b749"; // Test Authentication Header $authorization = "Authorization: Bearer pat-na1-e33479fd-da09-4d3f-b7ba-883334bb0751"; $processDate = date("Y-m-d",strtotime('today')); // Create a List and add the Contacts from this Upload to the list echo "<h3>Contact List</h3>"; // Setup varaibles for static list name $listDate = str_replace('-','',$processDate); $listNum = 0; // Retrieve all the lists in HubSpot $lists=array(); getHubSpotLists($lists,$authorization); $listExists=false; // search the lists until we find a name that has not been // created yet. do { $listExists = false; // look for next list $listLength = count($lists); $listNum++; // check next possible list name $listName = $listDate.'-upload-staticlist'.sprintf('%1$02d',$listNum); echo $listNum."\n"; for($i = 0; $i < $listLength; $i++){ if ($lists[$i]["name"] == $listName) { $listExists=true; // list name found } } } while ($listExists == true); echo "new list name ".$listName; //fwrite($outFile,"List Name is = ".$listName." exists list\n"); $listId=createHubSpotList($listName,$authorization); echo "new list ID is ".$listId; $contactEmails=["abby.proch@lifescienceconnect.com","ch.yu@jnpmedi.com"]; $result=addEmailsToHubSpotList($contactEmails,$listId,$authorization); var_dump($result);