mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
6555d8def4
relates to #12606 Implementation of the Windows automatic enrollment Fleet UI pages. This includes implementation of card for windows automatic enrollment, the setup page for windows automatic enrollment, and terms and conditions page for windows (This is currently still being worked on as our current solution is not working). **windows mdm auto enrollment card** ![image](https://github.com/fleetdm/fleet/assets/1153709/d4dc1813-dc28-4a63-bacd-cb7e43e18170) **windows auto enrollment setup page** ![image](https://github.com/fleetdm/fleet/assets/1153709/92da4b05-0d5d-4404-867f-6d315957bdc3) - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Marcos Oviedo <marcos@fleetdm.com>
50 lines
1007 B
Go
50 lines
1007 B
Go
package mail
|
|
|
|
import (
|
|
"bytes"
|
|
"html/template"
|
|
|
|
"github.com/fleetdm/fleet/v4/server"
|
|
)
|
|
|
|
type ChangeEmailMailer struct {
|
|
BaseURL template.URL
|
|
AssetURL template.URL
|
|
Token string
|
|
}
|
|
|
|
func (cem *ChangeEmailMailer) Message() ([]byte, error) {
|
|
t, err := server.GetTemplate("server/mail/templates/change_email_confirmation.html", "email_template")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
var msg bytes.Buffer
|
|
err = t.Execute(&msg, cem)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return msg.Bytes(), nil
|
|
}
|
|
|
|
type PasswordResetMailer struct {
|
|
// Base URL to use for Fleet endpoints
|
|
BaseURL template.URL
|
|
// URL for loading image assets
|
|
AssetURL template.URL
|
|
// Token password reset token
|
|
Token string
|
|
}
|
|
|
|
func (r PasswordResetMailer) Message() ([]byte, error) {
|
|
t, err := server.GetTemplate("server/mail/templates/password_reset.html", "email_template")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var msg bytes.Buffer
|
|
if err = t.Execute(&msg, r); err != nil {
|
|
return nil, err
|
|
}
|
|
return msg.Bytes(), nil
|
|
}
|