Skip to content

Commit

Permalink
Merge branch 'maxhowald/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondl committed Nov 13, 2017
2 parents 58c1136 + e1778e8 commit b55beb1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ type Config struct {

// EmailFrom is the email address authboss e-mails come from.
EmailFrom string
// EmailFromName is the name used in the From: header of authboss emails.
EmailFromName string
// EmailSubjectPrefix is used to add something to the front of the authboss
// email subjects.
EmailSubjectPrefix string
Expand Down
7 changes: 4 additions & 3 deletions confirm/confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ func (c *Confirm) confirmEmail(ctx *authboss.Context, to, token string) {
url := fmt.Sprintf("%s%s?%s=%s", c.RootURL, p, url.QueryEscape(FormValueConfirm), url.QueryEscape(token))

email := authboss.Email{
To: []string{to},
From: c.EmailFrom,
Subject: c.EmailSubjectPrefix + "Confirm New Account",
To: []string{to},
From: c.EmailFrom,
FromName: c.EmailFromName,
Subject: c.EmailSubjectPrefix + "Confirm New Account",
}

err := response.Email(ctx.Mailer, email, c.emailHTMLTemplates, tplConfirmHTML, c.emailTextTemplates, tplConfirmText, url)
Expand Down
9 changes: 5 additions & 4 deletions recover/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"path"
"time"

"golang.org/x/crypto/bcrypt"
"github.com/volatiletech/authboss"
"github.com/volatiletech/authboss/internal/response"
"golang.org/x/crypto/bcrypt"
)

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

email := authboss.Email{
To: []string{to},
From: r.EmailFrom,
Subject: r.EmailSubjectPrefix + "Password Reset",
To: []string{to},
From: r.EmailFrom,
FromName: r.EmailFromName,
Subject: r.EmailSubjectPrefix + "Password Reset",
}

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

0 comments on commit b55beb1

Please sign in to comment.