Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
99bb9d4f
Commit
99bb9d4f
authored
Aug 31, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(signup): added back the welcome on signup completed email
parent
d19e101e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
.gitignore
+1
-1
pkg/services/notifications/notifications.go
+16
-0
No files found.
.gitignore
View file @
99bb9d4f
...
@@ -28,4 +28,4 @@ public/css/*.min.css
...
@@ -28,4 +28,4 @@ public/css/*.min.css
conf/custom.ini
conf/custom.ini
fig.yml
fig.yml
profile.cov
profile.cov
grafana
pkg/services/notifications/notifications.go
View file @
99bb9d4f
...
@@ -19,6 +19,7 @@ import (
...
@@ -19,6 +19,7 @@ import (
var
mailTemplates
*
template
.
Template
var
mailTemplates
*
template
.
Template
var
tmplResetPassword
=
"reset_password.html"
var
tmplResetPassword
=
"reset_password.html"
var
tmplSignUpStarted
=
"signup_started.html"
var
tmplSignUpStarted
=
"signup_started.html"
var
tmplWelcomeOnSignUp
=
"welcome_on_signup.html"
func
Init
()
error
{
func
Init
()
error
{
initMailQueue
()
initMailQueue
()
...
@@ -28,6 +29,7 @@ func Init() error {
...
@@ -28,6 +29,7 @@ func Init() error {
bus
.
AddHandler
(
"email"
,
sendEmailCommandHandler
)
bus
.
AddHandler
(
"email"
,
sendEmailCommandHandler
)
bus
.
AddEventListener
(
signUpStartedHandler
)
bus
.
AddEventListener
(
signUpStartedHandler
)
bus
.
AddEventListener
(
signUpCompletedHandler
)
mailTemplates
=
template
.
New
(
"name"
)
mailTemplates
=
template
.
New
(
"name"
)
mailTemplates
.
Funcs
(
template
.
FuncMap
{
mailTemplates
.
Funcs
(
template
.
FuncMap
{
...
@@ -143,3 +145,17 @@ func signUpStartedHandler(evt *events.SignUpStarted) error {
...
@@ -143,3 +145,17 @@ func signUpStartedHandler(evt *events.SignUpStarted) error {
},
},
})
})
}
}
func
signUpCompletedHandler
(
evt
*
events
.
SignUpCompleted
)
error
{
if
evt
.
Email
==
""
||
!
setting
.
Smtp
.
SendWelcomeEmailOnSignUp
{
return
nil
}
return
sendEmailCommandHandler
(
&
m
.
SendEmailCommand
{
To
:
[]
string
{
evt
.
Email
},
Template
:
tmplSignUpStarted
,
Data
:
map
[
string
]
interface
{}{
"Name"
:
evt
.
Name
,
},
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment