          (= "" email-body))
       (js/alert "Wrong data! Check out fields!")
 
-      (ajax "/api/actions/test" "POST" data (fn [e])))))
-
-(defn wrap-error-alert [callback]
-  (fn [reply]
-    (let [resp (js->clj reply)]
-      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
-      (callback reply))))
+      (ajax "/api/actions/test" "POST" data 
+            (wrap-error-alert (fn [e]))))))
 
 
 (defn common-update-callback [msg data reply]


      (do
        (.modal ($ :#iModal) "hide")
        (ajax "/api/actions" "POST" data #(create-new-email-action-callback data %))))))


(defn test-new-email-action [project-id]


(defn create-new-email-action-callback [data reply]
  (let [resp (js->clj reply)]
    (when (= "ok" (get resp "result"))
      (state/update-project-actions (assoc data
                                      "id" (get resp "id")
                                      "last-processed-version" (get rest "last-processed-version"))))))


(defn send-new-email-action [project-id]
