예제 #1
0
 /*we use index 0 (ekm account id) to test if the line is an actual contact.
  * if index 0 is not blank then it is account/contact information and the contact
  * details will be found in successive lines.*/
 if ($order[0] != '') {
     // now we run a cursive check with existing ekm account id's to prevent duplicates
     for ($x = 0; $x <= $concount; $x++) {
         if ($ekmids[$x] == $order[0]) {
             $found = true;
             $sel = $x;
         }
     }
     if ($found != true) {
         if ($order[9] != '' && strpos('EKMUNIQUE', $order[9]) == 0 && $order[36] == 'COMPLETE') {
             //echo 'updating for email address '.$order[9].'<br>';
             $contact = new Infusionsoft_Contact();
             $eml = new Infusionsoft_EmailService();
             $grp = new Infusionsoft_ContactGroupAssign();
             $data = new Infusionsoft_DataService();
             $contact->addCustomField('_County');
             $contact->addCustomField('_County2');
             $contact->addCustomField('_ShippingCompany');
             $contact->addCustomField('_ShippingFirstName');
             $contact->addCustomField('_ShippingLastName');
             $contact->AccountId = $order[0];
             $contact->Email = $order[9];
             $contact->FirstName = $order[10];
             $contact->LastName = $order[11];
             $contact->Company = $order[12];
             $contact->StreetAddress1 = $order[13];
             $contact->StreetAddress2 = $order[14];
             $contact->City = $order[15];
<form>
Template Id: <input type="text" name="TemplateId">
<input type="submit">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['TemplateId'])) {
    $template = Infusionsoft_EmailService::getEmailTemplate($_REQUEST['TemplateId'] + 0);
    ?>
	<H1>Template Source (htmlBody)</H1>
	<?php 
    echo "<pre>" . $template['htmlBody'] . "</pre>";
}
}
?>
"><br/>
            receivedDate: <input type="text" name="receivedDate" value="<?php 
if (isset($_REQUEST['receivedDate'])) {
    echo htmlspecialchars($_REQUEST['receivedDate']);
}
?>
"><br/>
            sentDate: <input type="text" name="sentDate" value="<?php 
if (isset($_REQUEST['sentDate'])) {
    echo htmlspecialchars($_REQUEST['sentDate']);
}
?>
"><br/>
            emailSentType: <input type="text" name="emailSentType" value="<?php 
if (isset($_REQUEST['emailSentType'])) {
    echo htmlspecialchars($_REQUEST['emailSentType']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_EmailService::attachEmail($_REQUEST['contactId'], $_REQUEST['fromName'], $_REQUEST['fromAddress'], $_REQUEST['toAddress'], $_REQUEST['ccAddresses'], $_REQUEST['bccAddresses'], $_REQUEST['contentType'], $_REQUEST['subject'], $_REQUEST['htmlBody'], $_REQUEST['textBody'], $_REQUEST['header'], $_REQUEST['receivedDate'], $_REQUEST['sentDate'], $_REQUEST['emailSentType']);
    var_dump($out);
}