 (defonce ^:private send-pulses-job (atom nil))
 (defonce ^:private send-pulses-trigger (atom nil))
 
+(defn- monthday [dt]
+  (cond
+    (timepr/first-day-of-month? dt) :first
+    (timepr/last-day-of-month? dt)  :last
+    (= 15 (time/day dt))            :mid
+    :else                           :other))
+
+(defn- monthweek [dt]
+  (let [curr-day-of-month  (time/day dt)
+        last-of-month      (time/day (time/last-day-of-the-month dt))
+        start-of-last-week (- last-of-month 7)]
+    (cond
+      (> 8 curr-day-of-month)                  :first
+      (< start-of-last-week curr-day-of-month) :last
+      :else                                    :other)))
+
 ;; triggers the sending of all pulses which are scheduled to run in the current hour
 (jobs/defjob SendPulses
   [ctx]

                                    [triggers :as triggers])
            [clojurewerkz.quartzite.schedule.cron :as cron]
            [clj-time.core :as time]
            [metabase.db :as db]
            [metabase.driver :as driver]
            [metabase.email :as email]

        curr-hour          (time/hour now)
        curr-weekday       (->> (time/day-of-week now)
                                (get pulse-channel/days-of-week)
                                :id)
        curr-monthday      (monthday now)
        curr-monthweek     (monthweek now)]
    (send-pulses curr-hour curr-weekday curr-monthday curr-monthweek)))

(defn- task-init []
  ;; build our job
