vendor/mandrill/mandrill/src/Mandrill/Whitelists.php line 4

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