summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32015-02-12 18:49:02 +0100
committerHorus32015-02-12 18:49:02 +0100
commitcf66deeeba38263feef0ca4123a983cb78ce5cac (patch)
tree8afa0dc0c03b9f4979ef4d3a59b658cba3115fff
parent6a212d9dfc6e73a82f83229a5f45f6362c715800 (diff)
downloadwebmon-cf66deeeba38263feef0ca4123a983cb78ce5cac.tar.gz
Removed README
-rw-r--r--README.md75
-rw-r--r--app/controllers/app.go10
-rw-r--r--app/controllers/mail.go23
-rw-r--r--conf/app.conf2
-rw-r--r--conf/routes2
5 files changed, 32 insertions, 80 deletions
diff --git a/README.md b/README.md
deleted file mode 100644
index 246b5ba..0000000
--- a/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Welcome to Revel
-
-## Getting Started
-
-A high-productivity web framework for the [Go language](http://www.golang.org/).
-
-### Start the web server:
-
- revel run myapp
-
- Run with <tt>--help</tt> for options.
-
-### Go to http://localhost:9000/ and you'll see:
-
-"It works"
-
-### Description of Contents
-
-The default directory structure of a generated Revel application:
-
- myapp App root
- app App sources
- controllers App controllers
- init.go Interceptor registration
- models App domain models
- routes Reverse routes (generated code)
- views Templates
- tests Test suites
- conf Configuration files
- app.conf Main configuration file
- routes Routes definition
- messages Message files
- public Public assets
- css CSS files
- js Javascript files
- images Image files
-
-app
-
- The app directory contains the source code and templates for your application.
-
-conf
-
- The conf directory contains the application’s configuration files. There are two main configuration files:
-
- * app.conf, the main configuration file for the application, which contains standard configuration parameters
- * routes, the routes definition file.
-
-
-messages
-
- The messages directory contains all localized message files.
-
-public
-
- Resources stored in the public directory are static assets that are served directly by the Web server. Typically it is split into three standard sub-directories for images, CSS stylesheets and JavaScript files.
-
- The names of these directories may be anything; the developer need only update the routes.
-
-test
-
- Tests are kept in the tests directory. Revel provides a testing framework that makes it easy to write and run functional tests against your application.
-
-### Follow the guidelines to start developing your application:
-
-* The README file created within your application.
-* The [Getting Started with Revel](http://revel.github.io/tutorial/index.html).
-* The [Revel guides](http://revel.github.io/manual/index.html).
-* The [Revel sample apps](http://revel.github.io/samples/index.html).
-* The [API documentation](http://revel.github.io/docs/godoc/index.html).
-
-## Contributing
-We encourage you to contribute to Revel! Please check out the [Contributing to Revel
-guide](https://github.com/revel/revel/blob/master/CONTRIBUTING.md) for guidelines about how
-to proceed. [Join us](https://groups.google.com/forum/#!forum/revel-framework)!
diff --git a/app/controllers/app.go b/app/controllers/app.go
index 5b38540..9e5764f 100644
--- a/app/controllers/app.go
+++ b/app/controllers/app.go
@@ -180,8 +180,16 @@ 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)
- jobs.Now(AsyncConfirmRegistration(user, email, key))
+ jobs.Now(JobRegistration{User: user, Email: email, Key: key})
c.Flash.Success("A mail with a confirmation link was sent. Please confirm your mail adress now.")
return c.Redirect(App.PrintRegister)
}
+
+func (c App) Test(email, key string) revel.Result {
+ // jobs.Now(JobRegistration{User: "foobar", Email: email, Key: key})
+ Mailer{}.ConfirmRegistration("foobar", "raspi@dns.iamfabulous.de", "string")
+ c.Flash.Success("A mail with a confirmation link was sent. Please confirm your mail adress now.")
+
+ return c.Redirect(App.Index)
+}
diff --git a/app/controllers/mail.go b/app/controllers/mail.go
index 9ca992a..3fd2e94 100644
--- a/app/controllers/mail.go
+++ b/app/controllers/mail.go
@@ -1,11 +1,22 @@
package controllers
-import "github.com/tanema/revel_mailer"
+import (
+ "github.com/tanema/revel_mailer"
+)
type Mailer struct {
revel_mailer.Mailer
}
+type JobConfirmationKey struct {
+ Email string
+ Key string
+}
+
+func (j JobConfirmationKey) Run() {
+ _ = Mailer{}.SendConfirmationKey(j.Email, j.Key)
+}
+
func (u Mailer) SendConfirmationKey(email, key string) error {
return u.Send(revel_mailer.H{
"subject": "Confirmation Key",
@@ -14,8 +25,14 @@ func (u Mailer) SendConfirmationKey(email, key string) error {
})
}
-func (j jobs) AsyncConfirmRegistration(user, email, key string) {
- _ = Mailer{}.ConfirmRegistration(user, email, key)
+type JobRegistration struct {
+ User string
+ Email string
+ Key string
+}
+
+func (j JobRegistration) Run() {
+ _ = Mailer{}.ConfirmRegistration(j.User, j.Email, j.Key)
}
func (u Mailer) ConfirmRegistration(user, email, key string) error {
diff --git a/conf/app.conf b/conf/app.conf
index f410612..4324ed0 100644
--- a/conf/app.conf
+++ b/conf/app.conf
@@ -25,7 +25,7 @@ redis.port = "6379"
mail.host = localhost
mail.port = 25
mail.from = webmon
-mail.user = webmon@iamfabulous.de
+mail.username = webmon@iamfabulous.de
module.jobs = github.com/revel/revel/modules/jobs
diff --git a/conf/routes b/conf/routes
index 8af3aed..ba0c0aa 100644
--- a/conf/routes
+++ b/conf/routes
@@ -13,6 +13,8 @@ POST /register App.Register
GET /confirm App.Confirm
GET /account App.Account
+GET /test App.Test
+
# Ignore favicon requests
GET /favicon.ico 404