diff options
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/client/admin/emailtest.go | 13 | ||||
-rw-r--r-- | internal/api/model/admin.go | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/internal/api/client/admin/emailtest.go b/internal/api/client/admin/emailtest.go index 42b405ce7..9b214a926 100644 --- a/internal/api/client/admin/emailtest.go +++ b/internal/api/client/admin/emailtest.go @@ -54,6 +54,12 @@ import ( // in: formData // description: The email address that the test email should be sent to. // type: string +// required: true +// - +// name: message +// in: formData +// description: Optional message to include in the email. +// type: string // // security: // - OAuth2 Bearer: @@ -115,7 +121,12 @@ func (m *Module) EmailTestPOSTHandler(c *gin.Context) { return } - errWithCode := m.processor.Admin().EmailTest(c.Request.Context(), authed.Account, email.Address) + errWithCode := m.processor.Admin().EmailTest( + c.Request.Context(), + authed.Account, + email.Address, + form.Message, + ) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return diff --git a/internal/api/model/admin.go b/internal/api/model/admin.go index 637ab0ed7..4623a720f 100644 --- a/internal/api/model/admin.go +++ b/internal/api/model/admin.go @@ -201,7 +201,9 @@ type MediaCleanupRequest struct { // AdminSendTestEmailRequest models a test email send request (woah). type AdminSendTestEmailRequest struct { // Email address to send the test email to. - Email string `form:"email" json:"email" xml:"email"` + Email string `form:"email" json:"email"` + // Optional message to include in the test email. + Message string `form:"message" json:"message"` } type AdminInstanceRule struct { |