Message object contains information about single message, for example it  can be single email imported from inbox or 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) where does the message came from 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 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 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 message in associative array