diff options
| author | Horus_Arch | 2015-02-10 22:24:02 +0100 |
|---|---|---|
| committer | Horus_Arch | 2015-02-10 22:24:02 +0100 |
| commit | 6a212d9dfc6e73a82f83229a5f45f6362c715800 (patch) | |
| tree | d2985eb30fc22d2af628654e52484eda27b5dcf1 | |
| parent | 5a5d0fd250c28c3560ff00b9a367938e915eed7f (diff) | |
| download | webmon-6a212d9dfc6e73a82f83229a5f45f6362c715800.tar.gz | |
Try job feature.
| -rw-r--r-- | app/controllers/app.go | 5 | ||||
| -rw-r--r-- | app/controllers/mail.go | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/app.go b/app/controllers/app.go index fb11d01..5b38540 100644 --- a/app/controllers/app.go +++ b/app/controllers/app.go @@ -3,7 +3,7 @@ package controllers import ( "github.com/jinzhu/gorm" "github.com/revel/revel" - // "github.com/revel/revel/modules/jobs/app/jobs" + "github.com/revel/revel/modules/jobs/app/jobs" ) type App struct { @@ -179,7 +179,8 @@ func (c App) Register(email, confirmEmail, user, password, confirmPassword strin // Send email with confirmation link //jobs.Now(Mailer{}.ConfirmRegistration(email, key)) - _ = Mailer{}.ConfirmRegistration(user, email, key) + //_ = Mailer{}.ConfirmRegistration(user, email, key) + jobs.Now(AsyncConfirmRegistration(user, email, key)) c.Flash.Success("A mail with a confirmation link was sent. Please confirm your mail adress now.") return c.Redirect(App.PrintRegister) diff --git a/app/controllers/mail.go b/app/controllers/mail.go index b05da4e..9ca992a 100644 --- a/app/controllers/mail.go +++ b/app/controllers/mail.go @@ -14,6 +14,10 @@ func (u Mailer) SendConfirmationKey(email, key string) error { }) } +func (j jobs) AsyncConfirmRegistration(user, email, key string) { + _ = Mailer{}.ConfirmRegistration(user, email, key) +} + func (u Mailer) ConfirmRegistration(user, email, key string) error { return u.Send(revel_mailer.H{ "name": user, |
