             (.printStackTrace e)
             (error-response-structure job-name command e))))
 
+(defn replace-placeholder
+    [string placeholder-name value]
+    (if value
+        (clojure.string/replace string (str "<placeholder id=\"" placeholder-name "\" />") value)
+        string))
+
 (defn update-template
-    [template git-repo branch]
+    [template git-repo branch metadata]
     (-> template
-        (clojure.string/replace "<placeholder id=\"git-repo\" />" git-repo)
-        (clojure.string/replace "<placeholder id=\"git-branch\" />" (str "*/" branch))))
+        (replace-placeholder "git-repo"                   git-repo)
+        (replace-placeholder "git-branch"                 (str "*/" branch))
+        (replace-placeholder "metadata-language"          (get metadata :language))
+        (replace-placeholder "metadata-environment"       (get metadata :environment))
+        (replace-placeholder "metadata-content-directory" (get metadata :content_directory))
+        (replace-placeholder "metadata-content-type"      (get metadata :content_type))))
 
 (defn start-job
     [jenkins-url jenkins-auth include-jenkins-reply? job-name]

    (job-related-command jenkins-url jenkins-auth include-jenkins-reply? job-name "doDelete"))

(defn log-operation
    [job-name git-repo branch operation]
    (println "***" operation "***")
    (println "job-name" job-name)
    (println "git-repo" git-repo)
    (println "branch"   branch))

(defn send-configuration-xml-to-jenkins
    [url config]


(defn update-job
    [jenkins-url jenkins-auth include-jenkins-reply? job-name git-repo branch metadata]
    (log-operation job-name git-repo branch "update" metadata)
    (let [template (get-template metadata)
          config   (update-template template git-repo branch metadata)
          url      (str (job-name->url (update-jenkins-url jenkins-url jenkins-auth) job-name) "/config.xml")]
