private function buildTemplate($template)
    {
        $this->template = $template;
        $offset = "{
            x: $this->offsetX,
            y: $this->offsetY
        }";

        if ($this->offsetX == 20 && $this->offsetY == 20 || $this->offset == 20) {
            $offset = $this->offset;
        }

        $this->placement['enter'] = 'right';

        return "{
            icon: '$this->icon',
            title: '$this->title',
            message: '$this->message',
            url: '$this->url',
            target: '$this->target'
        }, {
            element: '$this->element',
            position: $this->position,
            type: '$this->type',
            allow_dismiss: $this->allowDismiss,
            newest_on_top: $this->newestFirst,
            showProgressbar: $this->progress,
            placement: " . json_encode($this->placement) . ",
            offset: $offset,
            spacing: $this->spacing,
            z_index: $this->zIndex,
            mouse_over: '$this->mouseOver',
            delay: $this->delay,
            timer: $this->timer,
            url_target: '$this->urlTarget',
            animate: " . json_encode($this->animate) . ",
            onShow: $this->onShow,
            onShown: $this->onShown,
            onClose: $this->onClose,
            onClosed: $this->onClosed,
            icon_type: '$this->iconType',
            template: `$this->template`
        }
        ";
    }