docs: private GroovyShell createEngine(ExtendedEmailPublisherDescriptor descriptor, Map<String, Object> variables, boolean secure)
              throws IOException {
  
          ClassLoader cl;
          CompilerConfiguration cc;
          if (secure) {
              cl = GroovySandbox.createSecureClassLoader(Jenkins.getActiveInstance().getPluginManager().uberClassLoader);
              cc = GroovySandbox.createSecureCompilerConfiguration();
          } else {
              cl = Jenkins.getActiveInstance().getPluginManager().uberClassLoader;
              cc = new CompilerConfiguration();
          }
          cc.setScriptBaseClass(EmailExtScript.class.getCanonicalName()); 
          cc.addCompilationCustomizers(new ImportCustomizer().addStarImports(
                  "jenkins",
                  "jenkins.model",
                  "hudson",
                  "hudson.model"));
  
          Binding binding = new Binding();
          for (Map.Entry<String, Object> e : variables.entrySet()) {
              binding.setVariable(e.getKey(), e.getValue());
          }
  
          return new GroovyShell(cl, binding, cc);
      }