private function getProcessedTemplateBeforeSave($result)
    {
        //saving array values
        if (empty($args)) {
            $this->getResultIfArgsEmptyForBeforeSave($result);
        } else {
            //saving string value
            $field = $args[0];

            //compress the text body when is a dotmailer template
            if ($field == 'template_text' && ! $this->isStringCompressed($result) &&
                $this->transactionalHelper->isDotmailerTemplate($this->templateCode)
            ) {
                $result = $this->compressString($result);
            }
            if ($field == 'template_id') {
                $this->saveTemplateIdInRegistry($result);
            }
        }

        return $result;
    }