minor code style changes

This commit is contained in:
dhax 2017-09-27 17:42:14 +02:00
parent 4c4041a981
commit 232463e1db
11 changed files with 82 additions and 74 deletions

View file

@ -2,7 +2,8 @@ package email
import "time"
type LoginTokenContent struct {
// ContentLoginToken defines content for login token email template
type ContentLoginToken struct {
Email string
Name string
URL string
@ -10,15 +11,16 @@ type LoginTokenContent struct {
Expiry time.Time
}
func (s *EmailService) LoginToken(name, address string, content LoginTokenContent) error {
msg := &Message{
from: NewEmail(s.fromName, s.from),
// LoginToken creates and sends a login token email with provided template content
func (m *Mailer) LoginToken(name, address string, content ContentLoginToken) error {
msg := &Mail{
from: NewEmail(m.fromName, m.from),
to: NewEmail(name, address),
subject: "Login Token",
template: "loginToken",
content: content,
}
err := s.send(msg)
err := m.Send(msg)
return err
}