Merge pull request #165 from gophish/162-from-test-email

Added ability to have "{{.From}}" in sending a test email.
pull/167/head
Jordan Wright 2016-02-17 21:15:08 -06:00
commit 2b58c56421
2 changed files with 4 additions and 3 deletions

View File

@ -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
}

View File

@ -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