Wie zu senden, führen über die API zu Getresponse

Ich habe ein html-Formular, wo name und E-Mail-Adresse werden immer gesammelt. Ich versuchen, zu senden diese Informationen, um eine Liste GetResponse verwenden Sie dieses Skript:

<?php

function mytheme_save_to_getresponse($form)
{

    require_once 'jsonRPCClient.php';
    $api_key = 'myAPIkey';
    $api_url = 'http://api2.getresponse.com';
    $client = new jsonRPCClient($api_url);
    $result = NULL;

try {
    $result = $client->get_campaigns(
        $api_key,
        array (
            # find by name literally
            'name' => array ( 'EQUALS' => 'testlist' )
        )
    );
}
catch (Exception $e) {
    # check for communication and response errors
    # implement handling if needed
    die($e->getMessage());
}

$campaigns = array_keys($result);
$CAMPAIGN_ID = array_pop($campaigns);

    $subscriberEmail =  $_GET['email'];

try {
    $result = $client->add_contact(
        $api_key,
        array (
            'campaign'  => $CAMPAIGN_ID,
            'name'     =>  $subscriberName,
            'email'     =>  $subscriberEmail,
            'cycle_day' => '0'
                    )
    );
}
catch (Exception $e) {
    # check for communication and response errors
    # implement handling if needed
    die($e->getMessage());
}
}
?>

Das Skript zeigt keinen Fehler, aber GetResponse ist nicht speichern die Führung auf meiner Liste. Mache ich etwas falsch?

Dank
James

InformationsquelleAutor mickzee | 2013-01-17
Schreibe einen Kommentar