Skip to content

A Clojure library designed to handle the work flow of sending an email for user verification.

Notifications You must be signed in to change notification settings

petterik/totalrecloj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

totalrecloj

A Clojure library designed to handle the work flow of sending an email for user verification.

Version: 0.1.0-SNAPSHOT

Lein: [totalrecloj "0.1.0-SNAPSHOT"]

The Name

The name is a Clojure twist on the movie title Total Recall, where the proccess of going to an email and comming back to the site for verification is supposed to be the "Recall".

Usage

  1. Implement the two protocolls TokenHandler and UserPersister.
  2. Call email-token!
(email-token! {:email "[email protected]"
                   :password "users-requested-password"
                   :host "url.to.your.site.com"
                   :endpoint "/verification/endpoint"
                   :token-handler token-handler-impl
                   :email-fn! email-fn-one-map-argument})
  1. Let the verification endpoint call verify-token! with token.
(verify-token! {:token token
                    :token-handler token-handler-impl
                    :user-persister user-persister-impl})

Example of email-fn! with postal:

(ns recloj.example
  (:require [postal.core :as mail]))

(defn send-email! [{:keys [to body subject]}]
  (mail/send-message ^{:host "smtp.gmail.com"
                       :user "gmail.user"
                       :pass "passw0rd"
                       :ssl :yes-please}
                      {:from "[email protected]"
                       :to to
                       :subject subject
                       :body body}))

License

Copyright © 2013 Splunk

Distributed under the Eclipse Public License, the same as Clojure.

About

A Clojure library designed to handle the work flow of sending an email for user verification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published