-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail.go
45 lines (37 loc) · 1.1 KB
/
email.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
39
40
41
42
43
44
45
package sendo
import "context"
type EmailSender struct {
Name string // optional
Email string // required
}
type EmailFrom struct {
Name string // optional
Email string // required
}
type EmailTo struct {
Name string // optional
Email string // required
}
type EmailCC struct {
Name string // optional
Email string // required
}
type EmailReplyTo struct {
Name string // optional
Email string // required
}
type SendSMTPEmailOptions struct {
Sender *EmailSender // optional, driver should support default sender per for each template
From *EmailFrom // for some drivers can be optional, for some other required.
To []EmailTo // required
CC []EmailCC // optional
ReplyTo *EmailReplyTo // optional
Subject *string // optional, drivers must support default subject for each template.
TemplateName string // required
Data interface{} // optional
Extra []interface{} // optional extra options.
// TODO: add attachment,...
}
type EmailService interface {
SendSMTP(ctx context.Context, o SendSMTPEmailOptions) error
}