File tree Expand file tree Collapse file tree 1 file changed +15
-23
lines changed Expand file tree Collapse file tree 1 file changed +15
-23
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments