diff options
| -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, |
