# File Mandrill/Whitelists.php

     1: <?php
     2:
     3: class Mandrill_Whitelists {
     4:     public function __construct(Mandrill $master) {
     5:         $this->master = $master;
     6:     }
     7:
     8:     /**
     9:      * Adds an email to your email rejection whitelist. If the address is
    10: currently on your blacklist, that blacklist entry will be removed
    11: automatically.
    12:      * @param string $email an email address to add to the whitelist
    13:      * @return struct a status object containing the address and the result of the operation
    14:      *     - email string the email address you provided
    15:      *     - whether boolean the operation succeeded
    16:      */
    17:     public function add($email) {
    18:         $_params = array("email" => $email);
    19:         return $this->master->call('whitelists/add', $_params);
    20:     }
    21:
    22:     /**
    23:      * Retrieves your email rejection whitelist. You can provide an email
    24: address or search prefix to limit the results. Returns up to 1000 results.
    25:      * @param string $email an optional email address or prefix to search by
    26:      * @return array up to 1000 whitelist entries
    27:      *     - return[] struct the information for each whitelist entry
    28:      *         - email string the email that is whitelisted
    29:      *         - detail string a description of why the email was whitelisted
    30:      *         - created_at string when the email was added to the whitelist
    31:      */
    32:     public function getList($email=null) {
    33:         $_params = array("email" => $email);
    34:         return $this->master->call('whitelists/list', $_params);
    35:     }
    36:
    37:     /**
    38:      * Removes an email address from the whitelist.
    39:      * @param string $email the email address to remove from the whitelist
    40:      * @return struct a status object containing the address and whether the deletion succeeded
    41:      *     - email string the email address that was removed from the blacklist
    42:      *     - deleted boolean whether the address was deleted successfully
    43:      */
    44:     public function delete($email) {
    45:         $_params = array("email" => $email);
    46:         return $this->master->call('whitelists/delete', $_params);
    47:     }
    48:
    49: }
    50:
    51:
    52: