Email: Reply-To feature added

Merged Vikram Ingawale requested to merge vi_emailReplyTo into devbranch
Compare and
2 files
+ 5
1
Preferences
File browser
Compare changes
@@ -47,6 +47,7 @@ func Init(tomlFilepath string) error {
type Email struct {
from string
replyTo string
to []string
cc []string
bcc []string
@@ -56,9 +57,10 @@ type Email struct {
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, replyTo, subject, body string) *Email {
return &Email{
from: from,
replyTo: replyTo,
to: to,
cc: cc,
bcc: bcc,
@@ -148,6 +150,7 @@ func (email *Email) Send() error {
message := gomail.NewMessage()
message.SetHeader("From", email.from)
message.SetHeader("To", email.to...)
message.SetHeader("Reply-To", email.replyTo)
message.SetHeader("Cc", email.cc...)
message.SetHeader("Bcc", email.bcc...)
message.SetHeader("Subject", email.subject)