Add template parsing and execution to mail service.
This commit is contained in:
parent
15974c9b77
commit
337ebb67b4
4 changed files with 38 additions and 14 deletions
|
|
@ -37,9 +37,9 @@ func NewContainer() *Container {
|
|||
c.initCache()
|
||||
c.initDatabase()
|
||||
c.initORM()
|
||||
c.initMail()
|
||||
c.initAuth()
|
||||
c.initTemplateRenderer()
|
||||
c.initMail()
|
||||
return c
|
||||
}
|
||||
|
||||
|
|
@ -135,14 +135,6 @@ func (c *Container) initORM() {
|
|||
}
|
||||
}
|
||||
|
||||
func (c *Container) initMail() {
|
||||
var err error
|
||||
c.Mail, err = NewMailClient(c.Config)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to create mail client: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Container) initAuth() {
|
||||
c.Auth = NewAuthClient(c.Config, c.ORM)
|
||||
}
|
||||
|
|
@ -150,3 +142,11 @@ func (c *Container) initAuth() {
|
|||
func (c *Container) initTemplateRenderer() {
|
||||
c.Templates = NewTemplateRenderer(c.Config)
|
||||
}
|
||||
|
||||
func (c *Container) initMail() {
|
||||
var err error
|
||||
c.Mail, err = NewMailClient(c.Config, c.Templates)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to create mail client: %v", err))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue