/** * This method takes the incoming data and figures out from it what the message type is and * evt_id/grp_id and uses that to generate the url for displaying the template in a browser. * * @since 4.5.0 * * @param EE_Messages_Addressee $recipient * @param string $sending_messenger * * @return string The generated url for displaying the link. * @throws EE_Error */ private function _get_url(EE_Messages_Addressee $recipient, $sending_messenger) { $reg = $recipient->reg_obj; $reg = !$reg instanceof EE_Registration ? $recipient->primary_reg_obj : $reg; if ($this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message) { EE_Registry::instance()->load_helper('MSG_Template'); try { return EEH_MSG_Template::get_url_trigger($this->_message_type, $this->_message, $reg, $sending_messenger); } catch (EE_Error $e) { if (WP_DEBUG) { $e->get_error(); } } } return ''; }