OK so I am interested in displaying social media account information for my contacts. Attentiv.ly looks awesome but very expensive :((
So I have been investigating other options and can now successfully pass a rest API via a php file to retrieve json from PIPL for a contact. Within civicrm I can create a link to the json using the email variable. I have temporarily (for exploratory purposes only don't worry!) hacked the email.tpl with this
<a href="https://api.fullcontact.com/v2/person.html?email={$item.email}&apiKey=XXXXXX"> social profile</alink
And when clicked it takes me to the correct social mediaprofile. It also works with the Fullcontact API. Hooray!!!
However what I really need is to somehow substitute the link for the script - but I can't put the PHP in the smarty template so now I'm stumped.
// $curl = curl_init();
// curl_setopt ($curl, CURLOPT_URL, "https://api.pipl.com/search/v4/?email=email@email.com&key=xxxxxxxxxxxxxx ");
// curl_exec ($curl);
// curl_close ($curl);
?>
Or this
//include_once '../creds.php';
//include_once '../Services/FullContact.php';
//initialize our FullContact API object
//get your api key here: http://fullcontact.com/getkey
//$fullcontact = new Services_FullContact_API($apikey);
//do a lookup
//$result = $fullcontact->doLookup('bart@fullcontact.com');
//dump our results
//echo "<br/>----------------<br/><pre>";
//print_r($result);
//echo "</pre><br/>----------------<br/>\n";
Obviously substituting the email for the civicrm email variable.
Or indeed if I am going about this entirely the wrong way I'm all ears!!!! All input welcome! Thank you!
PS if anyone can also tell me how to copy and paste code without it actually rendering that would be great