Example #1
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize list with list_id
$list = new Laposta_List();
try {
    // create new list, insert info as argument
    // $result will contain een array with the response from the server
    $result = $list->create(array('name' => 'Testlijst', 'remarks' => 'Een lijst om mee te testen', 'subscribe_notification_email' => '*****@*****.**', 'unsubscribe_notification_email' => '*****@*****.**'));
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Example #2
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize list
$list = new Laposta_List();
try {
    // get all members from this list
    // $result will contain een array with the response from the server
    $result = $list->all();
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Example #3
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize list with list_id
$list = new Laposta_List();
try {
    // (permanently) delete list, use list_id as argument
    // $result will contain een array with the response from the server
    $result = $list->delete("eVdOsH8Yxs");
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Example #4
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
Laposta::setHttpsDisableVerifyPeer(true);
// initialize list with list_id
$list = new Laposta_List();
try {
    // get list info, use list_id as argument
    // $result will contain een array with the response from the server
    $result = $list->get("BaImMu3JZA");
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Example #5
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize list with list_id
$list = new Laposta_List();
try {
    // update list, insert info as argument
    // $result will contain een array with the response from the server
    $result = $list->update('FKjs6srKdf', array('name' => 'Klanten'));
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}