diff --git a/emails/assets/css/style.css b/emails/assets/css/style.css index 7d5d7a7f759..f138a0c1296 100644 --- a/emails/assets/css/style.css +++ b/emails/assets/css/style.css @@ -109,8 +109,8 @@ table.columns td.better-button { } .better-button a { - text-decoration: none; - -webkit-border-radius: 2px; + text-decoration: none; + -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; @@ -123,7 +123,7 @@ table.columns td.better-button { .better-button:hover a { color: #FFFFFF !important; background-color: #F2821E; - border: 1px solid #F2821E; + border: 1px solid #F2821E; } .better-button:visited a { @@ -132,4 +132,13 @@ table.columns td.better-button { .better-button:active a { color: #FFFFFF !important; -} \ No newline at end of file +} + +.verification-code { + background-color: #EEEEEE; + padding: 3px; + margin: 8px; + display: inline-block; + font-weight: bold; + font-size: 20px; +} diff --git a/emails/templates/invited_to_org.html b/emails/templates/invited_to_org.html index 679c0062131..59e76cd5a77 100644 --- a/emails/templates/invited_to_org.html +++ b/emails/templates/invited_to_org.html @@ -32,17 +32,14 @@ - - - - -
Log in now
- - + + + + +
Log in now
- diff --git a/emails/templates/signup_started.html b/emails/templates/signup_started.html new file mode 100644 index 00000000000..39b369a1f7c --- /dev/null +++ b/emails/templates/signup_started.html @@ -0,0 +1,46 @@ +[[Subject .Subject "Welcome to Grafana, please complete your sign up!"]] + + + + + +
+ + + + + + +
+

Complete the signup

+
+ +
+ + + + + +
+ + + + + + + + +
+ Copy and past the email verification code:
+ [[.Code]]
in + the sign up form or use the link below. +
+ + + + +
Complete Sign Up
+
+
+ + diff --git a/grafana b/grafana new file mode 100755 index 00000000000..d363cea6a70 Binary files /dev/null and b/grafana differ diff --git a/pkg/services/notifications/notifications.go b/pkg/services/notifications/notifications.go index ccfb41420ee..2b041e9e4b7 100644 --- a/pkg/services/notifications/notifications.go +++ b/pkg/services/notifications/notifications.go @@ -3,7 +3,9 @@ package notifications import ( "bytes" "errors" + "fmt" "html/template" + "net/url" "path/filepath" "github.com/grafana/grafana/pkg/bus" @@ -16,7 +18,7 @@ import ( var mailTemplates *template.Template var tmplResetPassword = "reset_password.html" -var tmplWelcomeOnSignUp = "welcome_on_signup.html" +var tmplSignUpStarted = "signup_started.html" func Init() error { initMailQueue() @@ -121,17 +123,19 @@ func validateResetPasswordCode(query *m.ValidateResetPasswordCodeQuery) error { } func signUpStartedHandler(evt *events.SignUpStarted) error { - log.Info("User signed up: %s, send_option: %s", evt.Email, setting.Smtp.SendWelcomeEmailOnSignUp) + log.Info("User signup started: %s", evt.Email) - if evt.Email == "" || !setting.Smtp.SendWelcomeEmailOnSignUp { + if evt.Email == "" { return nil } return sendEmailCommandHandler(&m.SendEmailCommand{ To: []string{evt.Email}, - Template: tmplWelcomeOnSignUp, + Template: tmplSignUpStarted, Data: map[string]interface{}{ - "Email": evt.Email, + "Email": evt.Email, + "Code": evt.Code, + "SignUpUrl": setting.ToAbsUrl(fmt.Sprintf("signup/?email=%s&code=%s", url.QueryEscape(evt.Email), url.QueryEscape(evt.Code))), }, }) } diff --git a/public/app/controllers/signupCtrl.js b/public/app/controllers/signupCtrl.js index 366ec84df09..723e97e0182 100644 --- a/public/app/controllers/signupCtrl.js +++ b/public/app/controllers/signupCtrl.js @@ -14,10 +14,11 @@ function (angular, config) { $scope.formModel = {}; $scope.init = function() { - var email = $location.search().email; - $scope.formModel.orgName = email; - $scope.formModel.email = email; - $scope.formModel.username = email; + var params = $location.search(); + $scope.formModel.orgName = params.email; + $scope.formModel.email = params.email; + $scope.formModel.username = params.email; + $scope.formModel.code = params.code; }; $scope.submit = function() { diff --git a/public/app/partials/signup_step2.html b/public/app/partials/signup_step2.html index 0df3ea211de..aa5d94e884f 100644 --- a/public/app/partials/signup_step2.html +++ b/public/app/partials/signup_step2.html @@ -31,8 +31,8 @@
- - + +
diff --git a/public/emails/invited_to_org.html b/public/emails/invited_to_org.html index ae2d129fa83..acfe6c354fc 100644 --- a/public/emails/invited_to_org.html +++ b/public/emails/invited_to_org.html @@ -147,17 +147,14 @@ color: #FFFFFF !important; - - - - -
Log in now
- - + + + + +
Log in now
- diff --git a/public/emails/signup_started.html b/public/emails/signup_started.html new file mode 100644 index 00000000000..425f36f67e9 --- /dev/null +++ b/public/emails/signup_started.html @@ -0,0 +1,194 @@ + + + + + + + + + + + + + +
+
+ + + + + +
+
+ + + + + +
+ + + + + + +
+ +
+ +
+ +
+
+ + + + + + +
+ {{Subject .Subject "Welcome to Grafana, please complete your sign up!"}} + + + + + +
+ + + + + + +
+

Complete the signup

+
+ +
+ + + + + +
+ + + + + + + + +
+ Copy and past the email verification code:
+ {{.Code}}
in + the sign up form or use the link below. +
+ + + + +
Complete Sign Up
+
+
+ + + + + + + + + + + +
+
+
+ +