public function initialise_settings() { $this->dm_settings = n2dmcf7_get_options(); // connect to database options $this->dm_username = $this->dm_settings['dotmailer_username']; $this->dm_password = $this->dm_settings['dotmailer_password']; $params = array('username' => $this->dm_username, 'password' => $this->dm_password); $this->dm_client = new N2CF7_DotMailerConnect($this->dm_username, $this->dm_password); }
function n2dmcf7_dotmailer_addressbooks() { $dm_settings = n2dmcf7_get_options(); $dm_username = $dm_settings["dotmailer_username"]; $dm_password = $dm_settings["dotmailer_password"]; $dm_connection = new N2CF7_DotMailerConnect($dm_username, $dm_password); if (isset($dm_connection)) { if ($dm_connection->username != '' && $dm_connection->password != '') { $address_books = $dm_connection->listAddressBooks(); foreach ($address_books as $book) { ?> <div class="addressbook"> <p><b>ID:</b> <?php echo $book->ID; ?> - <b>Name: </b><?php echo $book->Name; ?> </p> </div> <?php } } } }