<?php
// client can de downloaded from https://github.com/Newsman/newsman-api-php
require_once("Newsman/Client.php");
// you can get your API KEY, your newsman_user_id and list_id from My account -> API
$newsman_user_id = "your-username";
$api_key = "your-api-key";
$list_id = "your-list-id";
// key / value array, must contain the list props which must be updated
$props = array(
"from_email" => "from email here", /* ex: newsletter@newsmanapp.com */
"from_name" => "from name here", /* ex: Newsman Newsletter */
"replyto_email" => "reply to email address", /* Reply To Email address */
"replyto_name" => "reply to name", /* Reply To Name */
"list_secret" => "list secret here", /* A list secret (password). Used in some hashes computation */
"link_params_append" => "link param here", /* A query string of params which will be appended to every url. Default is: "utm_term=nl-link&utm_source=nl-general&utm_content=##abonat_id_tld##&utm_medium=newsletter&utm_campaign=Adevarul-Newsletter-##date##" */
"send_rate_text" => "ex: daily", /* Text describing the send rate of a newsletter, ex: daily or every friday, ... */
"after_unsubscribe_goto" => "the responder page here" /* Url where user is redirected after he clicks the ##NEWSMAN:list_unsubscribe## link */
);
try {
$client = new Newsman_Client($newsman_user_id, $api_key);
$ret = $client->list->updateProps($list_id, $props);
} catch (Exception $e) {
//do something with the error, eg: log $e->getMessage()
}
return $ret;
?>