コード例 #1
0
 public function SendValidationEmail($firstname, $lastname, $eMail, $facebookid)
 {
     $db = new DB_Access();
     $apiConsumer = new F1Api();
     $found_individuals = $apiConsumer->peopleSearch($firstname, $lastname, $eMail);
     $guid = Util::getGuid();
     if (sizeof($found_individuals) > 0) {
         $db->SaveUserActivationCode($facebookid, $eMail, $guid, $found_individuals[0]);
     } else {
         $db->SaveUserActivationCode($facebookid, $eMail, $guid);
     }
     // Email Initialize
     ini_set("SMTP", AppConfig::$SMTP);
     ini_set('sendmail_from', AppConfig::$FromAddress);
     $Name = AppConfig::$SenderName;
     //senders name
     $email = AppConfig::$FromAddress;
     //senders e-mail adress
     $recipient = $eMail;
     //recipient
     $mail_body = "Please click the following link to validate your e-mail address.\n\n" . AppConfig::$app_url . '/validateemail.php?code=' . $guid;
     $subject = AppConfig::$app_name . ': E-mail Validation';
     //subject
     $header = "From: " . $Name . " <" . $email . ">\r\n";
     //optional headerfields
     mail($recipient, $subject, $mail_body, $header);
     //mail command :)
 }
コード例 #2
0
<?php

require_once 'AppConfig.php';
//require_once 'OAuthAPIClient.php';
require_once 'F1Api.php';
require_once 'Person.php';
// Get the access token here
/*
$access_token = '61344b1a-0e88-4ccc-8854-cc6219d83642';
$token_secret = '7e01bf18-cc44-4332-b40e-dc4ae501098a';
$apiConsumer = new OAuthAPIClient(AppConfig::$f1_base_url, AppConfig::$f1_default_church_code, AppConfig::$f1_key, AppConfig::$f1_secret);
$apiConsumer->setPathsFromConfig();
*/
$personId = 24643185;
//$personId = 1;
$apiConsumer = new F1Api();
/*
$decoded_str = strstr($apiConsumer->getPerson($personId), '{"person":{');
print 'decoded string:'.$decoded_str;

$json_array = json_decode($decoded_str, true);
print $json_array['person']['firstName'];
*/
//
// Get a person
//
/*
$response = $apiConsumer->getPerson($personId);
print '<br/>'."Person json:"."<br/>".$response."<br/>";
?>
<pre><?php print_r($response); ?></pre>