1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-01-22 05:09:42 +02:00

Port FromName fix from master

Originally contributed by Max Howald <maxhowald@gmail.com>
This commit is contained in:
Aaron L 2018-05-14 11:47:34 -07:00
parent 4d8f1e9638
commit bf1eb39403
3 changed files with 10 additions and 6 deletions

View File

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

View File

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

View File

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