code: func validateEmailTemplateFile(ctx *validation.Context, configSet, path string, content []byte) error {
  	// Validate file name.
  	rgx := emailTemplateFilenameRegexp(ctx.Context)
  	if !rgx.MatchString(path) {
  		ctx.Errorf("filename does not match %q", rgx.String())
  	}
  
  	// Validate file contents.
  	subject, body, err := splitEmailTemplateFile(string(content))
  	if err != nil {
  		ctx.Error(err)
  	} else {
  		// Note: Parse does not return an error if the template attempts to
  		// call an undefined template, e.g. {{template "does-not-exist"}}
  		if _, err = text.New("subject").Funcs(EmailTemplateFuncs).Parse(subject); err != nil {
  			ctx.Error(err) // error includes template name
  		}
  		// Due to luci-config limitation, we cannot detect an invalid reference to
  		// a sub-template defined in a different file.
  		if _, err = html.New("body").Funcs(EmailTemplateFuncs).Parse(body); err != nil {
  			ctx.Error(err) // error includes template name
  		}
  	}
  	return nil
  }
docs: // validateEmailTemplateFile validates an email template file, including
  // its filename and contents.