<commit_before>(ns pc.email
  (:require [clojure.string :as str]
            [hiccup.core :as hiccup]
            [pc.mailgun :as mailgun]))

(defn chat-invite-html [doc-id]
  (hiccup/html
   [:html
    [:body
     [:div "Hey there,"]
     [:div
      "Come draw with me on Precursor: "
      [:a {:href (str "https://prcrsr.com/document/" doc-id)}
       (str "https://prcrsr.com/document/" doc-id)]]
     [:div
      [:a {:href (str "https://prcrsr.com/document/" doc-id)}
       [:img {:width 256
              :src (str "https://prcrsr.com/document/" doc-id ".svg?printer-friendly=false")}]]]
     [:div {:style "font-size: 12px"}
      "If you think this message was an error, let us know: "
      [:a {:href "mailto:<EMAIL>"} "<EMAIL>"] "."]]]))

(defn send-chat-invite [{:keys [cust to-email doc-id]}]
  (mailgun/send-message {:from "Precursor <<EMAIL>>"
                         :to to-email
                         :subject (str/trim (str (:cust/first-name cust)
                                                 (when (and (:cust/first-name cust)<commit_msg>we can use pngs now!<commit_after>(ns pc.email
  (:require [clojure.string :as str]
            [hiccup.core :as hiccup]
            [pc.mailgun :as mailgun]))

(defn chat-invite-html [doc-id]
  (hiccup/html
   [:html
    [:body
     [:div "Hey there,"]
     [:div
      "Come draw with me on Precursor: "
      [:a {:href (str "https://prcrsr.com/document/" doc-id)}
       (str "https://prcrsr.com/document/" doc-id)]]
     [:div
      [:a {:href (str "https://prcrsr.com/document/" doc-id)}
       [:img {:width 256
              :src (str "https://prcrsr.com/document/" doc-id ".png?printer-friendly=false")}]]]
     [:div {:style "font-size: 12px"}
      "If you think this message was an error, let us know: "
      [:a {:href "mailto:<EMAIL>"} "<EMAIL>"] "."]]]))

(defn send-chat-invite [{:keys [cust to-email doc-id]}]
  (mailgun/send-message {:from "Precursor <<EMAIL>>"
                         :to to-email
                         :subject (str/trim (str (:cust/first-name cust)
                                                 (when (and (:cust/first-name cust)
{'fraction_non_alphanumeric': 0.18152123191787214, 'fraction_numerical': 0.004666355576294913, 'mean_word_length': 1.99023709902371, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '868419', 'n_tokens_mistral': 776, 'n_tokens_neox': 727, 'n_words': 183}