<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: HubSpot integration</title>
		<link>https://legacy.forums.gravityhelp.com/topic/hubspot-integration</link>
		<description>Gravity Support Forums Topic: HubSpot integration</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 23:46:02 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/hubspot-integration" rel="self" type="application/rss+xml" />

		<item>
			<title>sclemens on "HubSpot integration"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hubspot-integration#post-41928</link>
			<pubDate>Tue, 22 Nov 2011 19:22:53 +0000</pubDate>
			<dc:creator>sclemens</dc:creator>
			<guid isPermaLink="false">41928@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We're trying to have a Gravity form subit into HubSpot using the HubSpot form/lead API.&#60;/p&#62;
&#60;p&#62;We read this forum topic but there's no reply: &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/gform_after_submission-hook-with-3rd-api-hubspot&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/gform_after_submission-hook-with-3rd-api-hubspot&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Here is the code that we are unsuccessfully trying to execute in our functions.php. Any suggestions?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
/* Load the Theme class. */
require_once (TEMPLATEPATH . &#38;#39;/framework/theme.php&#38;#39;);

$theme = new Theme();
$theme-&#38;gt;init(array(
	&#38;#39;theme_name&#38;#39; =&#38;gt; &#38;#39;Striking&#38;#39;,
	&#38;#39;theme_slug&#38;#39; =&#38;gt; &#38;#39;striking&#38;#39;
));

add_action(&#38;quot;gform_after_submission&#38;quot;, &#38;quot;after_submission&#38;quot;, 10, 2);

function after_submission($entry, $form) {
  //START HubSpot Lead Submission
  $strPost = &#38;quot;&#38;quot;;
  //create string with form POST data
  $strPost = &#38;quot;FirstName=&#38;quot; . urlencode($_POST[&#38;#39;first_name&#38;#39;])
  . &#38;quot;&#38;amp;LastName=&#38;quot; . urlencode($_POST[&#38;#39;last_name&#38;#39;])
  . &#38;quot;&#38;amp;Email=&#38;quot; . urlencode($_POST[&#38;#39;email&#38;#39;])
  . &#38;quot;&#38;amp;TwitterHandle=&#38;quot; . urlencode($_POST[&#38;#39;twitter_handle’])
  . &#38;quot;&#38;amp;Phone=&#38;quot; . urlencode($_POST[&#38;#39;phone_number&#38;#39;])
  . &#38;quot;&#38;amp;Fax=&#38;quot; . urlencode($_POST[&#38;#39;fax_number&#38;#39;])
  . &#38;quot;&#38;amp;Website=&#38;quot; . urlencode($_POST[&#38;#39;website&#38;#39;])
  . &#38;quot;&#38;amp;Company=&#38;quot; . urlencode($_POST[&#38;#39;company&#38;#39;])
  . &#38;quot;&#38;amp;JobTitle=&#38;quot; . urlencode($_POST[&#38;#39;job_title&#38;#39;])
  . &#38;quot;&#38;amp;Address=&#38;quot; . urlencode($_POST[&#38;#39;address&#38;#39;])
  . &#38;quot;&#38;amp;City=&#38;quot; . urlencode($_POST[&#38;#39;city&#38;#39;])
  . &#38;quot;&#38;amp;State=&#38;quot; . urlencode($_POST[&#38;#39;state&#38;#39;])
  . &#38;quot;&#38;amp;ZipCode=&#38;quot; . urlencode($_POST[&#38;#39;zip_code&#38;#39;])
  . &#38;quot;&#38;amp;Country=&#38;quot; . urlencode($_POST[&#38;#39;country&#38;#39;])
  . &#38;quot;&#38;amp;Message=&#38;quot; . urlencode($_POST[&#38;#39;message&#38;#39;])
  . &#38;quot;&#38;amp;NumberEmployees=&#38;quot; . urlencode($_POST[&#38;#39;num_employees&#38;#39;])
  . &#38;quot;&#38;amp;AnnualRevenue=&#38;quot; . urlencode($_POST[&#38;#39;annual_revenue&#38;#39;])
  . &#38;quot;&#38;amp;CloseDate=&#38;quot; . urlencode($_POST[&#38;#39;close_date&#38;#39;])
  . &#38;quot;&#38;amp;IPAddress=&#38;quot; . urlencode($_SERVER[&#38;#39;REMOTE_ADDR&#38;#39;])
  . &#38;quot;&#38;amp;UserToken=&#38;quot; . urlencode($_COOKIE[&#38;#39;hubspotutk&#38;#39;]);

  //set POST URL
  $url = &#38;quot;http://insightsquared.app11.hubspot.com/?app=leaddirector&#38;amp;FormName=Contact+Us&#38;quot;;

  //intialize cURL and send POST data
  $ch = @curl_init();
  @curl_setopt($ch, CURLOPT_POST, true);
  @curl_setopt($ch, CURLOPT_POSTFIELDS, $strPost);
  @curl_setopt($ch, CURLOPT_URL, $url);
  @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  @curl_exec($ch);
  @curl_close($ch);
  //END HubSpot Lead Submission
}

?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
