mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
fallback to username if Name field is not set (#996)
* fallback to username if Name field is not set * add orgname field to invite emails
This commit is contained in:
parent
d1a259f4c0
commit
0c93c4db67
2 changed files with 7 additions and 1 deletions
|
|
@ -76,6 +76,7 @@ type InviteMailer struct {
|
|||
*Invite
|
||||
KolideServerURL template.URL
|
||||
InvitedByUsername string
|
||||
OrgName string
|
||||
}
|
||||
|
||||
func (i *InviteMailer) Message() ([]byte, error) {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ func (svc service) InviteNewUser(ctx context.Context, payload kolide.InvitePaylo
|
|||
return nil, err
|
||||
}
|
||||
|
||||
invitedBy := inviter.Name
|
||||
if invitedBy == "" {
|
||||
invitedBy = inviter.Username
|
||||
}
|
||||
inviteEmail := kolide.Email{
|
||||
Subject: "You're Invited to Kolide",
|
||||
To: []string{invite.Email},
|
||||
|
|
@ -61,7 +65,8 @@ func (svc service) InviteNewUser(ctx context.Context, payload kolide.InvitePaylo
|
|||
Mailer: &kolide.InviteMailer{
|
||||
Invite: invite,
|
||||
KolideServerURL: template.URL(config.KolideServerURL),
|
||||
InvitedByUsername: inviter.Name,
|
||||
OrgName: config.OrgName,
|
||||
InvitedByUsername: invitedBy,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue