Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
d1e292eb
Commit
d1e292eb
authored
Oct 30, 2015
by
Bobby Rullo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: pass issuer name to emailer
Issuer name can be used in Emailer
parent
c94e5384
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
config.go
server/config.go
+5
-2
No files found.
server/config.go
View file @
d1e292eb
...
@@ -85,7 +85,7 @@ func (cfg *ServerConfig) Server() (*Server, error) {
...
@@ -85,7 +85,7 @@ func (cfg *ServerConfig) Server() (*Server, error) {
return
nil
,
err
return
nil
,
err
}
}
err
=
setEmailer
(
&
srv
,
cfg
.
EmailFromAddress
,
cfg
.
EmailerConfigFile
,
cfg
.
EmailTemplateDirs
)
err
=
setEmailer
(
&
srv
,
cfg
.
IssuerName
,
cfg
.
EmailFromAddress
,
cfg
.
EmailerConfigFile
,
cfg
.
EmailTemplateDirs
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -238,7 +238,7 @@ func setTemplates(srv *Server, tpls *template.Template) error {
...
@@ -238,7 +238,7 @@ func setTemplates(srv *Server, tpls *template.Template) error {
return
nil
return
nil
}
}
func
setEmailer
(
srv
*
Server
,
fromAddress
,
emailerConfigFile
string
,
emailTemplateDirs
[]
string
)
error
{
func
setEmailer
(
srv
*
Server
,
issuerName
,
fromAddress
,
emailerConfigFile
string
,
emailTemplateDirs
[]
string
)
error
{
cfg
,
err
:=
email
.
NewEmailerConfigFromFile
(
emailerConfigFile
)
cfg
,
err
:=
email
.
NewEmailerConfigFromFile
(
emailerConfigFile
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -290,6 +290,9 @@ func setEmailer(srv *Server, fromAddress, emailerConfigFile string, emailTemplat
...
@@ -290,6 +290,9 @@ func setEmailer(srv *Server, fromAddress, emailerConfigFile string, emailTemplat
}
}
}
}
tMailer
:=
email
.
NewTemplatizedEmailerFromTemplates
(
textTemplates
,
htmlTemplates
,
emailer
)
tMailer
:=
email
.
NewTemplatizedEmailerFromTemplates
(
textTemplates
,
htmlTemplates
,
emailer
)
tMailer
.
SetGlobalContext
(
map
[
string
]
interface
{}{
"issuer_name"
:
issuerName
,
})
ue
:=
useremail
.
NewUserEmailer
(
srv
.
UserRepo
,
ue
:=
useremail
.
NewUserEmailer
(
srv
.
UserRepo
,
srv
.
PasswordInfoRepo
,
srv
.
PasswordInfoRepo
,
...
...
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