 (ns salava.mail.mail
   (:require [clojure.java.io :as io]
+            [clojure.tools.logging :as log]
             [hiccup.core :refer :all]
             [postal.core :refer [send-message]]
             [salava.core.util :refer [get-site-url get-base-path get-site-name get-plugins plugin-fun]]

      (if (nil? mail-host-config)
        (send-message data)
        (send-message mail-host-config data)))
    (catch Object _
      ;TODO log an error
      )))

(defn send-html-mail [ctx subject message recipients]
  (try+

        message (str fullname "\n\n" (t :core/Emailverification2 lng) " '" email "' " (t :core/Emailverification3 lng) " " site-url".\n" (t :core/Emailverification4 lng) ":\n\n"
                     email-verification-link
                     "\n\n" (t :core/Emailverification6 lng)".\n")]
    (log/info "sending to" email)
    (-> (send-mail ctx subject message [email]) log/info)))



