summaryrefslogtreecommitdiff
path: root/internal/email/signup.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-04-13 13:25:10 +0200
committerLibravatar GitHub <noreply@github.com>2024-04-13 13:25:10 +0200
commit89e0cfd8741b6763ca04e90558bccf4c3c380cfa (patch)
tree5858ada73473816fa1982f12717b66996d163f9d /internal/email/signup.go
parent[performance] update GetAccountsByIDs() to use the new multi cache loader end... (diff)
downloadgotosocial-89e0cfd8741b6763ca04e90558bccf4c3c380cfa.tar.xz
[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>
Diffstat (limited to 'internal/email/signup.go')
-rw-r--r--internal/email/signup.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/email/signup.go b/internal/email/signup.go
index 84162c21e..2eaffc8a9 100644
--- a/internal/email/signup.go
+++ b/internal/email/signup.go
@@ -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)
+}