<?php require_once '../include/bronto_funcs.php'; $bapi = bronto_login("0bba03f2000000000000000000000000310d"); $deliveries = $handler = array(); $deliveries['start'] = 'now'; $deliveries['messageId'] = "0bba03eb000000000000000000000006da48"; $recips = array(array('type' => 'contact', 'id' => "0bba03e80000000000000000000004a9cb9a"), array('type' => 'contact', 'id' => "0bba03e80000000000000000000004a9cb98")); $deliveries['recipients'] = $recips; $deliveries['fromEmail'] = '*****@*****.**'; $deliveries['fromName'] = 'Ken Zalewski'; $deliveries['replyEmail'] = '*****@*****.**'; $handler['mode'] = 'insert'; $params = array('deliveries' => $deliveries, 'handler' => $handler); $result = $bapi->writeDeliveries($params); print_r($result); //0bba03e80000000000000000000004a9cb98,b.krista@gmail.com //0bba03e80000000000000000000004a9cb9a,zalewski@senate.state.ny.us
/** * Log into Bronto using the agency account, then changing to the provided sub-account. * @param $account_id The sub-account to switch into. If null, then login as the agency (superuser). * @return See return value of bronto_login() */ function bronto_agency_login($account_id = null) { // Retrieve Agency account information from the config file. $cfg_rec = get_config_params(); if ($cfg_rec) { $agency_username = $cfg_rec['agency_username']; $agency_password = $cfg_rec['agency_password']; $agency_sitename = $cfg_rec['agency_sitename']; $params = array('username' => $agency_username, 'password' => $agency_password, 'sitename' => $agency_sitename, 'siteId' => $account_id); return bronto_login($params); } else { return null; } }
<?php require_once '../include/common.inc.php'; echo "Starting...\n"; $binding = bronto_login("0bba03f2000000000000000000000000310d"); $contacts = get_contacts($binding); if ($contacts == null) { die("Unable to get contacts"); } foreach ($contacts as $contact) { echo $contact->id . "," . $contact->email . "\n"; }