vendor/mandrill/mandrill/src/Mandrill/Exports.php line 5

Open in your IDE?
  1. <?php
  2. class Mandrill_Exports {
  3. public function __construct(Mandrill $master) {
  4. $this->master = $master;
  5. }
  6. /**
  7. * Returns information about an export job. If the export job's state is 'complete',
  8. the returned data will include a URL you can use to fetch the results. Every export
  9. job produces a zip archive, but the format of the archive is distinct for each job
  10. type. The api calls that initiate exports include more details about the output format
  11. for that job type.
  12. * @param string $id an export job identifier
  13. * @return struct the information about the export
  14. * - id string the unique identifier for this Export. Use this identifier when checking the export job's status
  15. * - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
  16. * - type string the type of the export job - activity, reject, or whitelist
  17. * - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
  18. * - state string the export job's state - waiting, working, complete, error, or expired.
  19. * - result_url string the url for the export job's results, if the job is completed.
  20. */
  21. public function info($id) {
  22. $_params = array("id" => $id);
  23. return $this->master->call('exports/info', $_params);
  24. }
  25. /**
  26. * Returns a list of your exports.
  27. * @return array the account's exports
  28. * - return[] struct the individual export info
  29. * - id string the unique identifier for this Export. Use this identifier when checking the export job's status
  30. * - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
  31. * - type string the type of the export job - activity, reject, or whitelist
  32. * - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
  33. * - state string the export job's state - waiting, working, complete, error, or expired.
  34. * - result_url string the url for the export job's results, if the job is completed.
  35. */
  36. public function getList() {
  37. $_params = array();
  38. return $this->master->call('exports/list', $_params);
  39. }
  40. /**
  41. * Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive
  42. containing a single file named rejects.csv that includes the following fields: email,
  43. reason, detail, created_at, expires_at, last_event_at, expires_at.
  44. * @param string $notify_email an optional email address to notify when the export job has finished.
  45. * @return struct information about the rejects export job that was started
  46. * - id string the unique identifier for this Export. Use this identifier when checking the export job's status
  47. * - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
  48. * - type string the type of the export job
  49. * - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
  50. * - state string the export job's state
  51. * - result_url string the url for the export job's results, if the job is complete
  52. */
  53. public function rejects($notify_email=null) {
  54. $_params = array("notify_email" => $notify_email);
  55. return $this->master->call('exports/rejects', $_params);
  56. }
  57. /**
  58. * Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive
  59. containing a single file named whitelist.csv that includes the following fields:
  60. email, detail, created_at.
  61. * @param string $notify_email an optional email address to notify when the export job has finished.
  62. * @return struct information about the whitelist export job that was started
  63. * - id string the unique identifier for this Export. Use this identifier when checking the export job's status
  64. * - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
  65. * - type string the type of the export job
  66. * - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
  67. * - state string the export job's state
  68. * - result_url string the url for the export job's results, if the job is complete
  69. */
  70. public function whitelist($notify_email=null) {
  71. $_params = array("notify_email" => $notify_email);
  72. return $this->master->call('exports/whitelist', $_params);
  73. }
  74. /**
  75. * Begins an export of your activity history. The activity will be exported to a zip archive
  76. containing a single file named activity.csv in the same format as you would be able to export
  77. from your account's activity view. It includes the following fields: Date, Email Address,
  78. Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom
  79. metadata fields, they will be included in the exported data.
  80. * @param string $notify_email an optional email address to notify when the export job has finished
  81. * @param string $date_from start date as a UTC string in YYYY-MM-DD HH:MM:SS format
  82. * @param string $date_to end date as a UTC string in YYYY-MM-DD HH:MM:SS format
  83. * @param array $tags an array of tag names to narrow the export to; will match messages that contain ANY of the tags
  84. * - tags[] string a tag name
  85. * @param array $senders an array of senders to narrow the export to
  86. * - senders[] string a sender address
  87. * @param array $states an array of states to narrow the export to; messages with ANY of the states will be included
  88. * - states[] string a message state
  89. * @param array $api_keys an array of api keys to narrow the export to; messsagse sent with ANY of the keys will be included
  90. * - api_keys[] string an API key associated with your account
  91. * @return struct information about the activity export job that was started
  92. * - id string the unique identifier for this Export. Use this identifier when checking the export job's status
  93. * - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
  94. * - type string the type of the export job
  95. * - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
  96. * - state string the export job's state
  97. * - result_url string the url for the export job's results, if the job is complete
  98. */
  99. public function activity($notify_email=null, $date_from=null, $date_to=null, $tags=null, $senders=null, $states=null, $api_keys=null) {
  100. $_params = array("notify_email" => $notify_email, "date_from" => $date_from, "date_to" => $date_to, "tags" => $tags, "senders" => $senders, "states" => $states, "api_keys" => $api_keys);
  101. return $this->master->call('exports/activity', $_params);
  102. }
  103. }