phpbb\notification\type\post::get_email_template_variables PHP Method

get_email_template_variables() public method

Get email template variables
    public function get_email_template_variables()
    {
        if ($this->get_data('post_username')) {
            $username = $this->get_data('post_username');
        } else {
            $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
        }
        return array('AUTHOR_NAME' => htmlspecialchars_decode($username), 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))), 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), 'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}", 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread", 'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", 'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}", 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?uid={$this->user_id}&f={$this->get_data('forum_id')}&t={$this->item_parent_id}&unwatch=topic");
    }

Usage Example

Beispiel #1
0
 /**
  * Get email template variables
  *
  * @return array
  */
 public function get_email_template_variables()
 {
     $user_data = $this->user_loader->get_user($this->get_data('poster_id'));
     return array_merge(parent::get_email_template_variables(), array('AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'])));
 }