diff --git a/models/campaign.go b/models/campaign.go index b813d456..69726650 100644 --- a/models/campaign.go +++ b/models/campaign.go @@ -72,6 +72,7 @@ type SendTestEmailRequest struct { URL string `json:"url"` Tracker string `json:"tracker"` TrackingURL string `json:"tracking_url"` + From string `json:"from"` Target } diff --git a/worker/worker.go b/worker/worker.go index 904b2849..67259de3 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -178,9 +178,9 @@ func SendTestEmail(s *models.SendTestEmailRequest) error { Logger.Println(err) return err } - ft := f.Name - if ft == "" { - ft = f.Address + s.From = f.Name + if s.From == "" { + s.From = f.Address } Logger.Println("Creating email using template") // Parse the templates