Documentation

Object Wphd_Model_Message

The message object contains information about a single message, for example, it can be a single email imported from your inbox or a message sent using submit ticket form.

  $message = new Wphd_Model_Message(100);
  echo $message->exists() . PHP_EOL;
  echo $message->title . PHP_EOL;

Properties

  • id – (int) unique number assigned to the message
  • source – (int) how the ticket was received – 1: email import, 2: submit ticket form (private), 3: submit ticket form (public)
  • thread_id – (int) ID of the thread to which the message belongs to
  • user_id – (int) ID of a user who submitted the message
  • agent_id – (int) ID of an agent who submitted the message or NULL if the message was not sent by the agent
  • type – (int) message type, one of 1: received, 2: note, 3: draft, 4: sent, 5: private, 6: trashed
  • message_id – (string) uniquely generated message id
  • created_at – (date) date when the message was created
  • title – (string) message title
  • from_name – (string) sender name
  • from_email – (string) sender email
  • to_name – (string) receiver name
  • to_email – (string) receiver email
  • body_text – (string) message content in plain text format
  • body_html – (string) message content in HTML format

Methods

  • delete() – deletes message from DB
  • exists() – checks if message exists
  • save() – saves message data in DB
  • toArray() – returns all information about the message in an associative array