mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Admin accounts endpoints; approve/reject sign-ups (#2826)
* update settings panels, add pending overview + approve/deny functions * add admin accounts get, approve, reject * send approved/rejected emails * use signup URL * docs! * email * swagger * web linting * fix email tests * wee lil fixerinos * use new paging logic for GetAccounts() series of admin endpoints, small changes to query building * shuffle useAccountIDIn check *before* adding to query * fix parse from toot react error * use `netip.Addr` * put valid slices in globals * optimistic updates for account state --------- Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
@@ -40,3 +40,39 @@ type NewSignupData struct {
|
||||
func (s *sender) SendNewSignupEmail(toAddresses []string, data NewSignupData) error {
|
||||
return s.sendTemplate(newSignupTemplate, newSignupSubject, data, toAddresses...)
|
||||
}
|
||||
|
||||
var (
|
||||
signupApprovedTemplate = "email_signup_approved.tmpl"
|
||||
signupApprovedSubject = "GoToSocial Sign-Up Approved"
|
||||
)
|
||||
|
||||
type SignupApprovedData struct {
|
||||
// Username to be addressed.
|
||||
Username string
|
||||
// URL of the instance to present to the receiver.
|
||||
InstanceURL string
|
||||
// Name of the instance to present to the receiver.
|
||||
InstanceName string
|
||||
}
|
||||
|
||||
func (s *sender) SendSignupApprovedEmail(toAddress string, data SignupApprovedData) error {
|
||||
return s.sendTemplate(signupApprovedTemplate, signupApprovedSubject, data, toAddress)
|
||||
}
|
||||
|
||||
var (
|
||||
signupRejectedTemplate = "email_signup_rejected.tmpl"
|
||||
signupRejectedSubject = "GoToSocial Sign-Up Rejected"
|
||||
)
|
||||
|
||||
type SignupRejectedData struct {
|
||||
// Message to the rejected applicant.
|
||||
Message string
|
||||
// URL of the instance to present to the receiver.
|
||||
InstanceURL string
|
||||
// Name of the instance to present to the receiver.
|
||||
InstanceName string
|
||||
}
|
||||
|
||||
func (s *sender) SendSignupRejectedEmail(toAddress string, data SignupRejectedData) error {
|
||||
return s.sendTemplate(signupRejectedTemplate, signupRejectedSubject, data, toAddress)
|
||||
}
|
||||
|
Reference in New Issue
Block a user