-
Notifications
You must be signed in to change notification settings - Fork 13
/
sender.go
38 lines (31 loc) · 966 Bytes
/
sender.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package mail
import (
"github.com/latolukasz/beeorm"
"github.com/coretrix/hitrix/service/component/config"
)
type NewSenderFunc func(configService config.IConfig) (Sender, error)
type Sender interface {
SendTemplate(ormService *beeorm.Engine, message *Message) error
SendTemplateAsync(ormService *beeorm.Engine, message *Message) error
SendTemplateWithAttachments(ormService *beeorm.Engine, message *MessageAttachment) error
SendTemplateWithAttachmentsAsync(ormService *beeorm.Engine, message *MessageAttachment) error
GetTemplateHTMLCode(ormService *beeorm.Engine, templateName string, ttl int) (string, error)
}
type Message struct {
From string
FromName string
ReplyTo string
To string
Subject string
TemplateName string
TemplateData interface{}
}
type Attachment struct {
ContentType string
Filename string
Base64Content string
}
type MessageAttachment struct {
Message
Attachments []Attachment
}