def METHOD_NAME(path, jinja_vars, j2_environment):
    """
    Renders a jinja template.
    Sceptre supports passing sceptre_user_data to JSON and YAML
    CloudFormation templates using Jinja2 templating.
    :param path: The path to the template file.
    :type path: str
    :param jinja_vars: Dict of variables to render into the template.
    :type jinja_vars: dict
    :param j2_environment: The jinja2 environment.
    :type stack_group_config: dict
    :returns: The body of the CloudFormation template.
    :rtype: str
    """
    path = Path(path)
    if not path.exists():
        raise TemplateNotFoundError("No such template file: '%s'", path)
    logger.debug("%s Rendering CloudFormation template", path)
    default_j2_environment_config = {
        "autoescape": select_autoescape(
            disabled_extensions=("j2",),
            default=True,
        ),
        "loader": FileSystemLoader(path.parent),
        "undefined": StrictUndefined,
    }
    j2_environment_config = strategies.dict_merge(
        default_j2_environment_config, j2_environment
    )
    j2_environment = Environment(**j2_environment_config)
    template = j2_environment.get_template(path.name)
    body = template.render(**jinja_vars)
    return body