瀏覽代碼

[Email] Text to BodyText & HTML to BodyHTML

Signed-off-by: Vishal Rana <vr@labstack.com>
Vishal Rana 7 年之前
父節點
當前提交
588f4e8bdd
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      email/email.go

+ 6 - 6
email/email.go

@@ -26,8 +26,8 @@ type (
 		To          string  `json:"to"`
 		CC          string  `json:"cc"`
 		Subject     string  `json:"subject"`
-		Text        string  `json:"text"`
-		HTML        string  `json:"html"`
+		BodyText    string  `json:"body_text"`
+		BodyHTML    string  `json:"body_html"`
 		Inlines     []*File `json:"inlines"`
 		Attachments []*File `json:"attachments"`
 		buffer      *bytes.Buffer
@@ -105,10 +105,10 @@ func (e *Email) Send(m *Message) (err error) {
 	m.buffer.WriteString("\r\n")
 
 	// Message body
-	if m.Text != "" {
-		m.writeText(m.Text, "text/plain")
-	} else if m.HTML != "" {
-		m.writeText(m.HTML, "text/html")
+	if m.BodyText != "" {
+		m.writeText(m.BodyText, "text/plain")
+	} else if m.BodyHTML != "" {
+		m.writeText(m.BodyHTML, "text/html")
 	} else {
 		// TODO:
 	}