protected function parseTemplate($network)
    {
        $button = '';

        if (!in_array($network, $this->exclude)) {
            $url = $this->networks[$network];

            switch ($this->type) {
                case self::TYPE_EXTRA_SMALL:
                    $button = str_replace(
                        '{button}',
                        '<a href="#" class="btn btn-sm btn-social-icon btn-{network}" onClick="sharePopup(\'' . $url . '\');">'
                        . '<i class="fa fa-{network}"></i></a>',
                        $this->template
                    );
                    break;
                case self::TYPE_SMALL:
                    $button = str_replace(
                        '{button}',
                        '<a href="#" class="btn btn-social-icon btn-{network}" onClick="return sharePopup(\'' . $url . '\');">'
                        . '<i class="fa fa-{network}"></i></a>',
                        $this->template
                    );
                    break;
                case self::TYPE_LARGE:
                    $button = str_replace(
                        '{button}',
                        '<a href="#" class="btn btn-block btn-social btn-{network}" onClick="return sharePopup(\'' . $url . '\');">'
                        . '<i class="fa fa-{network}"></i> {text}</a>',
                        $this->template
                    );
                    break;
                default:
                    break;
            }
        }

        if ($button) {
            $url = $this->url;
            if ($this->addUtm) {
                $delimitBy = '?';
                if (strpos($this->url, '?')) {
                    $delimitBy = '&';
                }
                $url .= ($delimitBy . $this->buildUtm($network));
            }

            $button = str_replace(
                [
                    '{text}', '{network}', '{url}',
                    '{title}', '{description}', '{image}'
                ],
                [
                    $this->text, $network, urlencode($url),
                    urlencode($this->title), urlencode($this->description), urlencode($this->image)
                ],
                $button
            );
        }

        return $button;
    }