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