コード例 #1
0
/**
 * Outputs the list of all recipients for a given email list.
 *
 * @param  Zend_Gdata_Gapps $gapps     The service object to use for communicating with the Google
 *                                     Apps server.
 * @param  boolean          $html      True if output should be formatted for display in a web browser.
 * @param  string           $emailList The email list whose recipients should be output.
 * @return void
 */
function retrieveAllRecipients($gapps, $html, $emailList)
{
    if ($html) {
        echo "<h2>Email List Recipients For {$emailList}</h2>\n";
    }
    $feed = $gapps->retrieveAllRecipients($emailList);
    if ($html) {
        echo "<ul>\n";
    }
    foreach ($feed as $recipient) {
        if ($html) {
            echo "  <li>";
        } else {
            echo "  * ";
        }
        echo $recipient->who->email;
        if ($html) {
            echo '</li>';
        }
        echo "\n";
    }
    if ($html) {
        echo "</ul>\n";
    }
}