/**
  * Add note to Help Scout conversation.
  * 
  * @access public
  * @param int $note_id - The ID of the created note.
  * @param int $entry_id - The ID of the entry the note belongs to.
  * @param int $user_id - The ID of the user who created the note.
  * @param string $user_name - The name of the user who created the note.
  * @param string $note - The note contents.
  * @param string $note_type - The note type.
  * @return void
  */
 public function add_note_to_conversation($note_id, $entry_id, $user_id, $user_name, $note, $note_type)
 {
     /* If Add Note checkbox not selected, exit. */
     if (rgpost('helpscout_add_note') != '1') {
         return;
     }
     /* Get the entry. */
     $entry = GFAPI::get_entry($entry_id);
     $conversation_id = $this->get_entry_converstaion_id($entry);
     /* If API is not initialized or entry does not have a Help Scout conversation ID, exit. */
     if (!$this->initialize_api() || !$conversation_id) {
         return;
     }
     /* Get API user. */
     $api_user = $this->api->getUserMe();
     /* Create note object. */
     $hs_note = new \HelpScout\model\thread\Message();
     $hs_note->setCreatedBy($this->api->getUserRefProxy($api_user->getId()));
     $hs_note->setBody($note);
     $hs_note->setType('note');
     try {
         /* Post note to conversation. */
         $this->api->createThread($conversation_id, $hs_note);
         /* Log that note was added. */
         $this->log_debug(__METHOD__ . '(): Note was successfully added to conversation.');
     } catch (Exception $e) {
         /* Log that note was not added. */
         $this->log_error(__METHOD__ . '(): Note was not added to conversation; ' . $e->getMessage());
     }
 }