Skip to content

Commit

Permalink
Port FromName fix from master
Browse files Browse the repository at this point in the history
Originally contributed by Max Howald <[email protected]>
  • Loading branch information
aarondl committed May 14, 2018
1 parent 4d8f1e9 commit bf1eb39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ type Config struct {
Mail struct {
// From is the email address authboss e-mails come from.
From string
// FromName is the name authboss e-mails come from.
FromName string
// SubjectPrefix is used to add something to the front of the authboss
// email subjects.
SubjectPrefix string
Expand Down
7 changes: 4 additions & 3 deletions confirm/confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ func (c *Confirm) SendConfirmEmail(ctx context.Context, to, token string) {
url := fmt.Sprintf("%s%s?%s=%s", c.Paths.RootURL, p, url.QueryEscape(FormValueConfirm), url.QueryEscape(token))

email := authboss.Email{
To: []string{to},
From: c.Config.Mail.From,
Subject: c.Config.Mail.SubjectPrefix + "Confirm New Account",
To: []string{to},
From: c.Config.Mail.From,
FromName: c.Config.Mail.FromName,
Subject: c.Config.Mail.SubjectPrefix + "Confirm New Account",
}

logger.Infof("sending confirm e-mail to: %s", to)
Expand Down
7 changes: 4 additions & 3 deletions recover/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ func (r *Recover) SendRecoverEmail(ctx context.Context, to, encodedToken string)
url := fmt.Sprintf("%s%s?%s", r.Authboss.Config.Paths.RootURL, p, query.Encode())

email := authboss.Email{
To: []string{to},
From: r.Authboss.Config.Mail.From,
Subject: r.Authboss.Config.Mail.SubjectPrefix + "Password Reset",
To: []string{to},
From: r.Authboss.Config.Mail.From,
FromName: r.Authboss.Config.Mail.FromName,
Subject: r.Authboss.Config.Mail.SubjectPrefix + "Password Reset",
}

ro := authboss.EmailResponseOptions{
Expand Down

0 comments on commit bf1eb39

Please sign in to comment.