diff --git a/satellite/console/consoleweb/consoleapi/auth.go b/satellite/console/consoleweb/consoleapi/auth.go index 423e43701..bc9673979 100644 --- a/satellite/console/consoleweb/consoleapi/auth.go +++ b/satellite/console/consoleweb/consoleapi/auth.go @@ -349,18 +349,13 @@ func (a *Auth) Register(w http.ResponseWriter, r *http.Request) { } link := a.ActivateAccountURL + "?token=" + token - userName := user.ShortName - if user.ShortName == "" { - userName = user.FullName - } a.mailService.SendRenderedAsync( ctx, - []post.Address{{Address: user.Email, Name: userName}}, + []post.Address{{Address: user.Email}}, &console.AccountActivationEmail{ ActivationLink: link, Origin: a.ExternalAddress, - UserName: userName, }, ) } @@ -684,24 +679,18 @@ func (a *Auth) ResendEmail(w http.ResponseWriter, r *http.Request) { return } - userName := user.ShortName - if user.ShortName == "" { - userName = user.FullName - } - link := a.ActivateAccountURL + "?token=" + token contactInfoURL := a.ContactInfoURL termsAndConditionsURL := a.TermsAndConditionsURL a.mailService.SendRenderedAsync( ctx, - []post.Address{{Address: user.Email, Name: userName}}, + []post.Address{{Address: user.Email}}, &console.AccountActivationEmail{ Origin: a.ExternalAddress, ActivationLink: link, TermsAndConditionsURL: termsAndConditionsURL, ContactInfoURL: contactInfoURL, - UserName: userName, }, ) } diff --git a/satellite/console/consoleweb/consoleql/mutation.go b/satellite/console/consoleweb/consoleql/mutation.go index e334c689d..91f0b1d76 100644 --- a/satellite/console/consoleweb/consoleql/mutation.go +++ b/satellite/console/consoleweb/consoleql/mutation.go @@ -139,6 +139,11 @@ func rootMutation(log *zap.Logger, service *console.Service, mailService *mailse }, }, Resolve: func(p graphql.ResolveParams) (interface{}, error) { + inviter, err := console.GetUser(p.Context) + if err != nil { + return nil, err + } + pID, _ := p.Args[FieldProjectID].(string) emails, _ := p.Args[FieldEmail].([]interface{}) @@ -182,7 +187,7 @@ func rootMutation(log *zap.Logger, service *console.Service, mailService *mailse &console.ProjectInvitationEmail{ Origin: origin, UserName: userName, - ProjectName: project.Name, + InviterEmail: inviter.Email, SignInLink: signIn, LetUsKnowURL: letUsKnowURL, TermsAndConditionsURL: termsAndConditionsURL, diff --git a/satellite/console/emailreminders/chore.go b/satellite/console/emailreminders/chore.go index b4b57a425..424cc7045 100644 --- a/satellite/console/emailreminders/chore.go +++ b/satellite/console/emailreminders/chore.go @@ -90,20 +90,15 @@ func (chore *Chore) Run(ctx context.Context) (err error) { authController := consoleapi.NewAuth(chore.log, nil, nil, nil, nil, nil, "", chore.address, "", "", "", "") link := authController.ActivateAccountURL + "?token=" + token - userName := u.ShortName - if u.ShortName == "" { - userName = u.FullName - } // blocking send allows us to verify that links are clicked in tests. if chore.useBlockingSend { err = chore.mailService.SendRendered( ctx, - []post.Address{{Address: u.Email, Name: userName}}, + []post.Address{{Address: u.Email}}, &console.AccountActivationEmail{ ActivationLink: link, Origin: authController.ExternalAddress, - UserName: userName, }, ) if err != nil { @@ -113,11 +108,10 @@ func (chore *Chore) Run(ctx context.Context) (err error) { } else { chore.mailService.SendRenderedAsync( ctx, - []post.Address{{Address: u.Email, Name: userName}}, + []post.Address{{Address: u.Email}}, &console.AccountActivationEmail{ ActivationLink: link, Origin: authController.ExternalAddress, - UserName: userName, }, ) } diff --git a/satellite/console/mail.go b/satellite/console/mail.go index 7ae4712dd..fde1aabb1 100644 --- a/satellite/console/mail.go +++ b/satellite/console/mail.go @@ -11,7 +11,6 @@ type AccountActivationEmail struct { ActivationLink string ContactInfoURL string TermsAndConditionsURL string - UserName string } // Template returns email template name. @@ -41,7 +40,7 @@ func (*ForgotPasswordEmail) Subject() string { return "Password recovery request type ProjectInvitationEmail struct { Origin string UserName string - ProjectName string + InviterEmail string SignInLink string LetUsKnowURL string ContactInfoURL string @@ -53,7 +52,7 @@ func (*ProjectInvitationEmail) Template() string { return "Invite" } // Subject gets email subject. func (email *ProjectInvitationEmail) Subject() string { - return "You were invited to join the Project " + email.ProjectName + return "You were invited to join a project on Storj" } // UnknownResetPasswordEmail is mailservice template with unknown password reset data. diff --git a/web/satellite/static/emails/Invite.html b/web/satellite/static/emails/Invite.html index bfb6bcdd1..663d86b01 100644 --- a/web/satellite/static/emails/Invite.html +++ b/web/satellite/static/emails/Invite.html @@ -422,9 +422,9 @@
- You were invited to the - {{ .ProjectName }} - on Storj + You were invited to join + a project + on Storj by {{ .InviterEmail }}
- Hi {{ .UserName }}, + Hi,
You created an account on Storj.