Mailchimp_Users

The Mailchimp Subscription Form Mailchimp Users class.

Defined (1)

The class is defined in the following location(s).

/classes/mailchimp/Mailchimp/Users.php  
  1. class Mailchimp_Users { 
  2. public function __construct(NM_Mailchimp $master) { 
  3. $this->master = $master; 
  4.  
  5. /** 
  6. * Invite a user to your account 
  7. * @param string $email 
  8. * @param string $role 
  9. * @param string $msg 
  10. * @return associative_array the method completion status 
  11. * - status string The status (success) of the call if it completed. Otherwise an error is thrown. 
  12. */ 
  13. public function invite($email, $role='viewer', $msg='') { 
  14. $_params = array("email" => $email, "role" => $role, "msg" => $msg); 
  15. return $this->master->call('users/invite', $_params); 
  16.  
  17. /** 
  18. * Resend an invite a user to your account. Note, if the same address has been invited multiple times, this will simpy re-send the most recent invite 
  19. * @param string $email 
  20. * @return associative_array the method completion status 
  21. * - status string The status (success) of the call if it completed. Otherwise an error is thrown. 
  22. */ 
  23. public function inviteResend($email) { 
  24. $_params = array("email" => $email); 
  25. return $this->master->call('users/invite-resend', $_params); 
  26.  
  27. /** 
  28. * Revoke an invitation sent to a user to your account. Note, if the same address has been invited multiple times, this will simpy revoke the most recent invite 
  29. * @param string $email 
  30. * @return associative_array the method completion status 
  31. * - status string The status (success) of the call if it completed. Otherwise an error is thrown. 
  32. */ 
  33. public function inviteRevoke($email) { 
  34. $_params = array("email" => $email); 
  35. return $this->master->call('users/invite-revoke', $_params); 
  36.  
  37. /** 
  38. * Retrieve the list of pending users invitations have been sent for. 
  39. * @return array structs for each invitation, including: 
  40. * - email string the email address the invitation was sent to 
  41. * - role string the role that will be assigned if they accept 
  42. * - sent_at string the time the invitation was sent. this will change if it's resent. 
  43. * - expiration string the expiration time for the invitation. this will change if it's resent. 
  44. * - msg string the welcome message included with the invitation 
  45. */ 
  46. public function invites() { 
  47. $_params = array(); 
  48. return $this->master->call('users/invites', $_params); 
  49.  
  50. /** 
  51. * Revoke access for a specified login 
  52. * @param string $username 
  53. * @return associative_array the method completion status 
  54. * - status string The status (success) of the call if it completed. Otherwise an error is thrown. 
  55. */ 
  56. public function loginRevoke($username) { 
  57. $_params = array("username" => $username); 
  58. return $this->master->call('users/login-revoke', $_params); 
  59.  
  60. /** 
  61. * Retrieve the list of active logins. 
  62. * @return array structs for each user, including: 
  63. * - id int the login id for this login 
  64. * - username string the username used to log in 
  65. * - name string a display name for the account - empty first/last names will return the username 
  66. * - email string the email tied to the account used for passwords resets and the ilk 
  67. * - role string the role assigned to the account 
  68. * - avatar string if available, the url for the login's avatar 
  69. * - global_user_id int the globally unique user id for the user account connected to 
  70. * - dc_unique_id string the datacenter unique id for the user account connected to, like helper/account-details 
  71. */ 
  72. public function logins() { 
  73. $_params = array(); 
  74. return $this->master->call('users/logins', $_params); 
  75.  
  76. /** 
  77. * Retrieve the profile for the login owning the provided API Key 
  78. * @return associative_array the current user's details, including: 
  79. * - id int the login id for this login 
  80. * - username string the username used to log in 
  81. * - name string a display name for the account - empty first/last names will return the username 
  82. * - email string the email tied to the account used for passwords resets and the ilk 
  83. * - role string the role assigned to the account 
  84. * - avatar string if available, the url for the login's avatar 
  85. * - global_user_id int the globally unique user id for the user account connected to 
  86. * - dc_unique_id string the datacenter unique id for the user account connected to, like helper/account-details 
  87. * - account_name string The name of the account to which the API key belongs 
  88. */ 
  89. public function profile() { 
  90. $_params = array(); 
  91. return $this->master->call('users/profile', $_params); 
  92.