Skip to content

Commit b55beb1

Browse files
committed
Merge branch 'maxhowald/master'
2 parents 58c1136 + e1778e8 commit b55beb1

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ type Config struct {
9494

9595
// EmailFrom is the email address authboss e-mails come from.
9696
EmailFrom string
97+
// EmailFromName is the name used in the From: header of authboss emails.
98+
EmailFromName string
9799
// EmailSubjectPrefix is used to add something to the front of the authboss
98100
// email subjects.
99101
EmailSubjectPrefix string

confirm/confirm.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ func (c *Confirm) confirmEmail(ctx *authboss.Context, to, token string) {
149149
url := fmt.Sprintf("%s%s?%s=%s", c.RootURL, p, url.QueryEscape(FormValueConfirm), url.QueryEscape(token))
150150

151151
email := authboss.Email{
152-
To: []string{to},
153-
From: c.EmailFrom,
154-
Subject: c.EmailSubjectPrefix + "Confirm New Account",
152+
To: []string{to},
153+
From: c.EmailFrom,
154+
FromName: c.EmailFromName,
155+
Subject: c.EmailSubjectPrefix + "Confirm New Account",
155156
}
156157

157158
err := response.Email(ctx.Mailer, email, c.emailHTMLTemplates, tplConfirmHTML, c.emailTextTemplates, tplConfirmText, url)

recover/recover.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
"path"
1313
"time"
1414

15-
"golang.org/x/crypto/bcrypt"
1615
"github.com/volatiletech/authboss"
1716
"github.com/volatiletech/authboss/internal/response"
17+
"golang.org/x/crypto/bcrypt"
1818
)
1919

2020
// Storage constants
@@ -208,9 +208,10 @@ func (r *Recover) sendRecoverEmail(ctx *authboss.Context, to, encodedToken strin
208208
url := fmt.Sprintf("%s%s?%s", r.RootURL, p, query.Encode())
209209

210210
email := authboss.Email{
211-
To: []string{to},
212-
From: r.EmailFrom,
213-
Subject: r.EmailSubjectPrefix + "Password Reset",
211+
To: []string{to},
212+
From: r.EmailFrom,
213+
FromName: r.EmailFromName,
214+
Subject: r.EmailSubjectPrefix + "Password Reset",
214215
}
215216

216217
if err := response.Email(ctx.Mailer, email, r.emailHTMLTemplates, tplInitHTMLEmail, r.emailTextTemplates, tplInitTextEmail, url); err != nil {

0 commit comments

Comments
 (0)