private function prepareMessageUsingTemplate(
        CNabuMessagingTemplate $nb_template,
        CNabuLanguage $nb_language,
        array $params = null
    ) : array
    {
        $nb_engine = CNabuEngine::getEngine();

        if (is_string($interface_name = $nb_template->getRenderInterface()) &&
            is_string($provider_key = $nb_template->getRenderProvider()) &&
            count(list($vendor_key, $module_key) = preg_split("/:/", $provider_key)) === 2 &&
            ($nb_manager = $nb_engine->getProviderManager($vendor_key, $module_key)) instanceof INabuMessagingModule &&
            ($nb_interface = $nb_manager->createTemplateRenderInterface($interface_name)) instanceof INabuMessagingTemplateRenderInterface
        ) {
            $nb_interface->setTemplate($nb_template);
            $nb_interface->setLanguage($nb_language);
            $subject = $nb_interface->createSubject($params);
            $body_html = $nb_interface->createBodyHTML($params);
            $body_text = $nb_interface->createBodyText($params);

            return array($subject, $body_html, $body_text);
        } else {
            throw new ENabuMessagingException(ENabuMessagingException::ERROR_INVALID_TEMPLATE_RENDER_INSTANCE);
        }
    }