fleet/server/mail/invite.go
RachelElysia aeb852e168
Remove username from UI (#1168)
* Remove username from UI code
* Remove username from tests
* Remove username from database
* Modify server endpoints for removing username
* Implement backend aspects of removing username
* Update API docs
* Add name to fleetctl
2021-06-24 13:42:29 -07:00

31 lines
565 B
Go

package mail
import (
"bytes"
"html/template"
"github.com/fleetdm/fleet/server/fleet"
)
// InviteMailer is used to build an email template for the invite email.
type InviteMailer struct {
*fleet.Invite
BaseURL template.URL
AssetURL template.URL
InvitedBy string
OrgName string
}
func (i *InviteMailer) Message() ([]byte, error) {
t, err := getTemplate("server/mail/templates/invite_token.html")
if err != nil {
return nil, err
}
var msg bytes.Buffer
if err = t.Execute(&msg, i); err != nil {
return nil, err
}
return msg.Bytes(), nil
}