     (.mouseenter $copy-to-clipboard get-url-evt-handler)
     ; Change text of qtip when user clicks the copy-to-clipboard <button>
     (.on zcbClient "copy" (fn [] (.set qtipApi "content.text" "Copied!")))
-    (qtip-for-sharing-button ($ :#share-by-email) "Share via Email")
-    (qtip-for-sharing-button ($ :#share-on-twitter) "Share via Twitter")))
+    (qtip-for-sharing-button $share-by-email  "Share via Email")
+    (qtip-for-sharing-button ($ :#share-on-twitter) "Share via Twitter")
+    (.click $share-by-email
+            (get-short-url-jq-evt-handler-maker $urlShortenerInput
+                                                localStorage
+                                                :email))))
 
 ; Main entry point of the program
 (defn ^:export init [acad-year sem]


         :complete (fn []
                     (set! SHORTENING-IN-PROGRESS
                           (disj SHORTENING-IN-PROGRESS currentUrl)))}))

(defn- get-short-url-jq-evt-handler-maker
  "Returns a function suitable for a jQuery event handler; the returned function
   tries to obtain a short url and sets the result in the #url-shortener
   <input>"
  [$urlShortenerInput localStorage]
  (fn []
    (let [currentUrl (aget js/document "URL")
          localStorageKey (str "shortUrl-" currentUrl)

        localStorage        (aget js/window "localStorage")
        zcbClient           (ZeroClipboard. $copy-to-clipboard)
        $urlShortenerInput  ($ :#url-shortener)
        $share-by-email     ($ :#share-by-email)
        get-url-evt-handler (get-short-url-jq-evt-handler-maker
                              $urlShortenerInput localStorage)
        qtipOrgCopyText     "Copy to Clipboard"
