Simplified emailing system and combined mailer and notifications packages

This commit is contained in:
Torkel Ödegaard
2015-06-08 16:51:25 +02:00
parent c8bc0b3bf8
commit 42fc68baa5
6 changed files with 54 additions and 66 deletions
+5 -23
View File
@@ -5,12 +5,11 @@ import "errors"
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
type SendEmailCommand struct {
To []string
From string
Subject string
Body string
Massive bool
Info string
To []string
Template string
Data map[string]interface{}
Massive bool
Info string
}
type SendResetPasswordEmailCommand struct {
@@ -21,20 +20,3 @@ type ValidateResetPasswordCodeQuery struct {
Code string
Result *User
}
// create mail content
func (m *SendEmailCommand) Content() string {
contentType := "text/html; charset=UTF-8"
content := "From: " + m.From + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
return content
}
// Create html mail command
func NewSendEmailCommand(To []string, From, Subject, Body string) SendEmailCommand {
return SendEmailCommand{
To: To,
From: From,
Subject: Subject,
Body: Body,
}
}