Skip to content

Instantly share code, notes, and snippets.

@ksnider
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save ksnider/8902049 to your computer and use it in GitHub Desktop.

Select an option

Save ksnider/8902049 to your computer and use it in GitHub Desktop.
<?php
/*
++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++
++ ++
++ Get GF data from query ++
++ string and write it to IS ++
++ ++
++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++
*/
// entryId={entry_id}&formId={form_id}&contactId={Contact ID:15}&FirstName={First Name:12}&wants_appt={wants_appt:7}&dfy_notify={dfy_notify:10}&stay_in={stay_in:9}
// http://trainandsimple.com/got-it/?entryId=60&formId=4&contactId=18853&FirstName=Dritte&wants_appt=Yes&dfy_notify=Yes&stay_in=Stay+In
// Get quiz values from query string
<?php
$formId = $_GET['formId'];
$entryId = $_GET['entryId'];
$contactId = $_GET['contactId'];
$fname = $_GET['FirstName'];
$wants_appt = $_GET['wants_appt'];
$dfy_notify = $_GET['dfy_notify'];
$stay_in = $_GET['stay_in'];
// Connect to Infusionsoft
require_once($_SERVER['DOCUMENT_ROOT']."/scripts/isdk.php");
$app = new iSDK;
if ($app->cfgCon("connectionName")) {
$result = $app->grpAssign($contactId, 1447); // Apply Form tag
$result = $app->grpAssign($contactId, 567); // Apply Bus Unit tag
?>
<h3> Got it, <?php echo $fname; ?>!</h3>
Just to recap the actions I am going to take based on what you told me:<br/><br/>
<ul>
<li><?php if($wants_appt == 'Yes') {
echo "I will <strong>send you an appointment link</strong> so we can discuss your project. You should receive that within the next 24 hours.";
$result = $app->grpAssign($contactId, 1449); // Assign Wants appt tag
} else {
echo "You aren't interested in an appointment right now. No action on my part at this time.";
} ?></li>
<li><?php if($stay_in == 'Opt Out') {
echo "I will stop registering you for the webinar series. Don't forget ... you can always re-register. ";
$result = $app->grpAssign($contactId, 1233); // Opt Out of Webinar tag
} else {
echo "You are an eternal optimist. I like that! <strong>I am leaving you in the webinar series</strong> until I hear from you otherwise.";
} ?></li>
<li><?php if($dfy_notify == 'Yes') {
echo "You will <strong>be among the first to know</strong> about our new service when we announce it. Seriously, this is going to make life sooo much easier.";
$result = $app->grpAssign($contactId, 1451); // Requested notification when DFY launches
} else {
echo "You said <strong>you didn't want to be notified</strong> when our new service is available ... OK. I am just going to tell you straight out. <strong>You made a mistake on this one</strong>. Email me if you want to change your mind ... <a href='mailto:[email protected]'>[email protected]</a>";
} ?></li>
<li>Lastly, <strong>I will review the rest of your responses</strong> and, if there is anything I can add or offer there, I will get back to you. OK?</li>
</ul>
<h4>So ... are you the slightest bit curious how I customized this page based on your answers?</h4>
Pretty slick, eh? Did you notice that I never once asked you for your name or email address? And yet, here it is, on the thank you page. Because, of course, I knew it from the email I sent you. <br/><br/>
And what sort of API evangelist would I be if all of this didn't go into Infusionsoft, using the Infusionsoft API, so whatever needs to happen, happens automatically, right?<br/><br/>
This is an object lesson in the sorts of things you can do with just a tiny bit of code knowledge. It is the power of what I call <a href="http://trainandsimple.com/80-20-php-register" target="_blank">80/20 Programming</a>.<br/><br/>
Oh, and all this? The custom thank you page? This also happens to be the subject of the webinar on Thursday, February 6, 2014. If you miss it, the recording will be in <a href="http://trainandsimple.com/category/free-resources/" target="_blank">Free Resources</a>.<?php if($stay_in == 'Opt Out') {
echo " (You want to reconsider opting out now, don't you?)";
}?><br/><br/>
If you need to reach me, my direct line is 214-509-8540 and my email address is <a href='mailto:[email protected]'>[email protected]</a>. Hopefully, we will talk soon.<br/><br/>
Warmest Regards,</br>
<img alt="Kim Snider" src="http://trainandsimple.com/images/sigs/signature.jpg" /><br/>
Kim Snider<br/><br/><br/><br/>
<?php
} else {
echo "Not Connected...";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment