Commit d814b6cc authored by Akshay Bharambe's avatar Akshay Bharambe
Browse files

Add: Method to add alternate text fro email

1. Add: Method to add alternate text fro email
parent c7d3abd9
Branches
Tags
1 merge request!77Add: Alternate text for email
Showing with 6 additions and 1 deletion
...@@ -53,7 +53,7 @@ type Email struct { ...@@ -53,7 +53,7 @@ type Email struct {
subject string subject string
attachments []string attachments []string
body string body string
plainBody string plainBody string // alternate text if template fails
} }
func NewEmail(to, cc, bcc, attachments []string, from, subject, body string) *Email { func NewEmail(to, cc, bcc, attachments []string, from, subject, body string) *Email {
...@@ -68,6 +68,11 @@ func NewEmail(to, cc, bcc, attachments []string, from, subject, body string) *Em ...@@ -68,6 +68,11 @@ func NewEmail(to, cc, bcc, attachments []string, from, subject, body string) *Em
} }
} }
// SetAlternateText - set alternate text for email
func (email *Email) SetAlternateText(plainBody string) {
email.plainBody = plainBody
}
// SendMail - send email service sends email as per the given html template and data // SendMail - send email service sends email as per the given html template and data
//templateData can contain any type of values, including array, slice, map, struct and func //templateData can contain any type of values, including array, slice, map, struct and func
func (email *Email) SendMail(templateFilePath string, templateData interface{}) error { func (email *Email) SendMail(templateFilePath string, templateData interface{}) error {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment