PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/php/mandrill-api-php/src/Mandrill/Users.php

https://gitlab.com/urbanjunglestudio/movidly_admin
PHP | 132 lines | 22 code | 8 blank | 102 comment | 0 complexity | 4d867eabee9f3a94bad477a54bf41674 MD5 | raw file
  1. <?php
  2. class Mandrill_Users {
  3. public function __construct(Mandrill $master) {
  4. $this->master = $master;
  5. }
  6. /**
  7. * Return the information about the API-connected user
  8. * @return struct the user information including username, key, reputation, quota, and historical sending stats
  9. * - username string the username of the user (used for SMTP authentication)
  10. * - created_at string the date and time that the user's Mandrill account was created as a UTC string in YYYY-MM-DD HH:MM:SS format
  11. * - public_id string a unique, permanent identifier for this user
  12. * - reputation integer the reputation of the user on a scale from 0 to 100, with 75 generally being a "good" reputation
  13. * - hourly_quota integer the maximum number of emails Mandrill will deliver for this user each hour. Any emails beyond that will be accepted and queued for later delivery. Users with higher reputations will have higher hourly quotas
  14. * - backlog integer the number of emails that are queued for delivery due to exceeding your monthly or hourly quotas
  15. * - stats struct an aggregate summary of the account's sending stats
  16. * - today struct stats for this user so far today
  17. * - sent integer the number of emails sent for this user so far today
  18. * - hard_bounces integer the number of emails hard bounced for this user so far today
  19. * - soft_bounces integer the number of emails soft bounced for this user so far today
  20. * - rejects integer the number of emails rejected for sending this user so far today
  21. * - complaints integer the number of spam complaints for this user so far today
  22. * - unsubs integer the number of unsubscribes for this user so far today
  23. * - opens integer the number of times emails have been opened for this user so far today
  24. * - unique_opens integer the number of unique opens for emails sent for this user so far today
  25. * - clicks integer the number of URLs that have been clicked for this user so far today
  26. * - unique_clicks integer the number of unique clicks for emails sent for this user so far today
  27. * - last_7_days struct stats for this user in the last 7 days
  28. * - sent integer the number of emails sent for this user in the last 7 days
  29. * - hard_bounces integer the number of emails hard bounced for this user in the last 7 days
  30. * - soft_bounces integer the number of emails soft bounced for this user in the last 7 days
  31. * - rejects integer the number of emails rejected for sending this user in the last 7 days
  32. * - complaints integer the number of spam complaints for this user in the last 7 days
  33. * - unsubs integer the number of unsubscribes for this user in the last 7 days
  34. * - opens integer the number of times emails have been opened for this user in the last 7 days
  35. * - unique_opens integer the number of unique opens for emails sent for this user in the last 7 days
  36. * - clicks integer the number of URLs that have been clicked for this user in the last 7 days
  37. * - unique_clicks integer the number of unique clicks for emails sent for this user in the last 7 days
  38. * - last_30_days struct stats for this user in the last 30 days
  39. * - sent integer the number of emails sent for this user in the last 30 days
  40. * - hard_bounces integer the number of emails hard bounced for this user in the last 30 days
  41. * - soft_bounces integer the number of emails soft bounced for this user in the last 30 days
  42. * - rejects integer the number of emails rejected for sending this user in the last 30 days
  43. * - complaints integer the number of spam complaints for this user in the last 30 days
  44. * - unsubs integer the number of unsubscribes for this user in the last 30 days
  45. * - opens integer the number of times emails have been opened for this user in the last 30 days
  46. * - unique_opens integer the number of unique opens for emails sent for this user in the last 30 days
  47. * - clicks integer the number of URLs that have been clicked for this user in the last 30 days
  48. * - unique_clicks integer the number of unique clicks for emails sent for this user in the last 30 days
  49. * - last_60_days struct stats for this user in the last 60 days
  50. * - sent integer the number of emails sent for this user in the last 60 days
  51. * - hard_bounces integer the number of emails hard bounced for this user in the last 60 days
  52. * - soft_bounces integer the number of emails soft bounced for this user in the last 60 days
  53. * - rejects integer the number of emails rejected for sending this user in the last 60 days
  54. * - complaints integer the number of spam complaints for this user in the last 60 days
  55. * - unsubs integer the number of unsubscribes for this user in the last 60 days
  56. * - opens integer the number of times emails have been opened for this user in the last 60 days
  57. * - unique_opens integer the number of unique opens for emails sent for this user in the last 60 days
  58. * - clicks integer the number of URLs that have been clicked for this user in the last 60 days
  59. * - unique_clicks integer the number of unique clicks for emails sent for this user in the last 60 days
  60. * - last_90_days struct stats for this user in the last 90 days
  61. * - sent integer the number of emails sent for this user in the last 90 days
  62. * - hard_bounces integer the number of emails hard bounced for this user in the last 90 days
  63. * - soft_bounces integer the number of emails soft bounced for this user in the last 90 days
  64. * - rejects integer the number of emails rejected for sending this user in the last 90 days
  65. * - complaints integer the number of spam complaints for this user in the last 90 days
  66. * - unsubs integer the number of unsubscribes for this user in the last 90 days
  67. * - opens integer the number of times emails have been opened for this user in the last 90 days
  68. * - unique_opens integer the number of unique opens for emails sent for this user in the last 90 days
  69. * - clicks integer the number of URLs that have been clicked for this user in the last 90 days
  70. * - unique_clicks integer the number of unique clicks for emails sent for this user in the last 90 days
  71. * - all_time struct stats for the lifetime of the user's account
  72. * - sent integer the number of emails sent in the lifetime of the user's account
  73. * - hard_bounces integer the number of emails hard bounced in the lifetime of the user's account
  74. * - soft_bounces integer the number of emails soft bounced in the lifetime of the user's account
  75. * - rejects integer the number of emails rejected for sending this user so far today
  76. * - complaints integer the number of spam complaints in the lifetime of the user's account
  77. * - unsubs integer the number of unsubscribes in the lifetime of the user's account
  78. * - opens integer the number of times emails have been opened in the lifetime of the user's account
  79. * - unique_opens integer the number of unique opens for emails sent in the lifetime of the user's account
  80. * - clicks integer the number of URLs that have been clicked in the lifetime of the user's account
  81. * - unique_clicks integer the number of unique clicks for emails sent in the lifetime of the user's account
  82. */
  83. public function info() {
  84. $_params = array();
  85. return $this->master->call('users/info', $_params);
  86. }
  87. /**
  88. * Validate an API key and respond to a ping
  89. * @return string the string "PONG!"
  90. */
  91. public function ping() {
  92. $_params = array();
  93. return $this->master->call('users/ping', $_params);
  94. }
  95. /**
  96. * Validate an API key and respond to a ping (anal JSON parser version)
  97. * @return struct a struct with one key "PING" with a static value "PONG!"
  98. */
  99. public function ping2() {
  100. $_params = array();
  101. return $this->master->call('users/ping2', $_params);
  102. }
  103. /**
  104. * Return the senders that have tried to use this account, both verified and unverified
  105. * @return array an array of sender data, one for each sending addresses used by the account
  106. * - return[] struct the information on each sending address in the account
  107. * - address string the sender's email address
  108. * - created_at string the date and time that the sender was first seen by Mandrill as a UTC date string in YYYY-MM-DD HH:MM:SS format
  109. * - sent integer the total number of messages sent by this sender
  110. * - hard_bounces integer the total number of hard bounces by messages by this sender
  111. * - soft_bounces integer the total number of soft bounces by messages by this sender
  112. * - rejects integer the total number of rejected messages by this sender
  113. * - complaints integer the total number of spam complaints received for messages by this sender
  114. * - unsubs integer the total number of unsubscribe requests received for messages by this sender
  115. * - opens integer the total number of times messages by this sender have been opened
  116. * - clicks integer the total number of times tracked URLs in messages by this sender have been clicked
  117. * - unique_opens integer the number of unique opens for emails sent for this sender
  118. * - unique_clicks integer the number of unique clicks for emails sent for this sender
  119. */
  120. public function senders() {
  121. $_params = array();
  122. return $this->master->call('users/senders', $_params);
  123. }
  124. }