protected function getHookType($name)
    {
        $type = TemplateDefinition::FRONT_OFFICE;

        if (null !== $name && \is_string($name)) {
            $name = preg_replace("[^a-z]", "", strtolower(trim($name)));
            if (\in_array($name, array('bo', 'back', 'backoffice'))) {
                $type = TemplateDefinition::BACK_OFFICE;
            } elseif (\in_array($name, array('email'))) {
                $type = TemplateDefinition::EMAIL;
            } elseif (\in_array($name, array('pdf'))) {
                $type = TemplateDefinition::PDF;
            }
        }

        return $type;
    }