Mailchimp_Conversations

The Mailchimp Subscription Form Mailchimp Conversations class.

Defined (1)

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

/classes/mailchimp/Mailchimp/Conversations.php  
  1. class Mailchimp_Conversations { 
  2. public function __construct(NM_Mailchimp $master) { 
  3. $this->master = $master; 
  4.  
  5. /** 
  6. * Retrieve conversation metadata, includes message data for the most recent message in the conversation 
  7. * @param string $list_id 
  8. * @param string $leid 
  9. * @param string $campaign_id 
  10. * @param int $start 
  11. * @param int $limit 
  12. * @return associative_array Conversation data and metadata 
  13. * - count int Total number of conversations, irrespective of pagination. 
  14. * - data array An array of structs representing individual conversations 
  15. * - unique_id string A string identifying this particular conversation 
  16. * - message_count int The total number of messages in this conversation 
  17. * - campaign_id string The unique identifier of the campaign this conversation is associated with (will be null if the campaign has been deleted) 
  18. * - list_id string The unique identifier of the list this conversation is associated with 
  19. * - unread_messages int The number of messages in this conversation which have not yet been read. 
  20. * - from_label string A label representing the sender of this message. 
  21. * - from_email string The email address of the sender of this message. 
  22. * - subject string The subject of the message. 
  23. * - timestamp string Date the message was either sent or received. 
  24. * - last_message associative_array The most recent message in the conversation 
  25. * - from_label string A label representing the sender of this message. 
  26. * - from_email string The email address of the sender of this message. 
  27. * - subject string The subject of the message. 
  28. * - message string The plain-text content of the message. 
  29. * - read boolean Whether or not this message has been marked as read. 
  30. * - timestamp string Date the message was either sent or received. 
  31. */ 
  32. public function getList($list_id=null, $leid=null, $campaign_id=null, $start=0, $limit=25) { 
  33. $_params = array("list_id" => $list_id, "leid" => $leid, "campaign_id" => $campaign_id, "start" => $start, "limit" => $limit); 
  34. return $this->master->call('conversations/list', $_params); 
  35.  
  36. /** 
  37. * Retrieve conversation messages 
  38. * @param string $conversation_id 
  39. * @param boolean $mark_as_read 
  40. * @param int $start 
  41. * @param int $limit 
  42. * @return associative_array Message data and metadata 
  43. * - count int The number of messages in this conversation, irrespective of paging. 
  44. * - data array An array of structs representing each message in a conversation 
  45. * - from_label string A label representing the sender of this message. 
  46. * - from_email string The email address of the sender of this message. 
  47. * - subject string The subject of the message. 
  48. * - message string The plain-text content of the message. 
  49. * - read boolean Whether or not this message has been marked as read. 
  50. * - timestamp string Date the message was either sent or received. 
  51. */ 
  52. public function messages($conversation_id, $mark_as_read=false, $start=0, $limit=25) { 
  53. $_params = array("conversation_id" => $conversation_id, "mark_as_read" => $mark_as_read, "start" => $start, "limit" => $limit); 
  54. return $this->master->call('conversations/messages', $_params); 
  55.  
  56. /** 
  57. * Reply to a conversation 
  58. * @param string $conversation_id 
  59. * @param string $message 
  60. * @return associative_array Message data from the created message 
  61. * - from_label string A label representing the sender of this message. 
  62. * - from_email string The email address of the sender of this message. 
  63. * - subject string The subject of the message. 
  64. * - message string The plain-text content of the message. 
  65. * - read boolean Whether or not this message has been marked as read. 
  66. * - timestamp string Date the message was either sent or received. 
  67. */ 
  68. public function reply($conversation_id, $message) { 
  69. $_params = array("conversation_id" => $conversation_id, "message" => $message); 
  70. return $this->master->call('conversations/reply', $_params); 
  71.