Skip to content

Commit a9635b9

Browse files
committed
Email: removed json tags and templates
Signed-off-by: Vishal Rana <[email protected]>
1 parent 9cedb42 commit a9635b9

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

email/email.go

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,23 @@ type (
2424
}
2525

2626
Message struct {
27-
ID string `json:"id"`
28-
From string `json:"from"`
29-
To string `json:"to"`
30-
CC string `json:"cc"`
31-
Subject string `json:"subject"`
32-
Text string `json:"text"`
33-
HTML string `json:"html"`
34-
TemplateName string `json:"template_name"`
35-
TemplateData interface{} `json:"template_data"`
36-
Inlines []*File `json:"inlines"`
37-
Attachments []*File `json:"attachments"`
38-
buffer *bytes.Buffer
39-
boundary string
27+
ID string
28+
From string
29+
To string
30+
CC string
31+
Subject string
32+
Text string
33+
HTML string
34+
Inlines []*File
35+
Attachments []*File
36+
buffer *bytes.Buffer
37+
boundary string
4038
}
4139

4240
File struct {
43-
Name string `json:"name"`
44-
Type string `json:"type"`
45-
Content string `json:"content"`
41+
Name string
42+
Type string
43+
Content string
4644
}
4745
)
4846

@@ -93,13 +91,7 @@ func (e *Email) Send(m *Message) (err error) {
9391
m.buffer.WriteString("\r\n")
9492

9593
// Message body
96-
if m.TemplateName != "" {
97-
buf := new(bytes.Buffer)
98-
if err = e.Template.ExecuteTemplate(buf, m.TemplateName, m.TemplateData); err != nil {
99-
return
100-
}
101-
m.writeText(buf.String(), "text/html")
102-
} else if m.Text != "" {
94+
if m.Text != "" {
10395
m.writeText(m.Text, "text/plain")
10496
} else if m.HTML != "" {
10597
m.writeText(m.HTML, "text/html")

0 commit comments

Comments
 (0)