feat(cabana): mail preview and test send to yourself

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-13 13:02:49 +01:00
parent 4fd2ed07eb
commit 0c73c8d4f1
22 changed files with 1233 additions and 16 deletions

View File

@@ -623,6 +623,42 @@ func AdminMailImagesShow() {}
// @Router /mail/images [post]
func AdminMailImagesUpload() {}
// AdminMailPreview documents POST /mail/preview.
//
// @Summary Preview a mail draft
// @Description Renders an unsaved template, layout, partial or branding draft through postcard's Editor with sample values. Mode template needs system.manage_mail_templates; layout, partial and branding need system.manage_mail_layouts. A draft that does not render is 422 with details field, rule and message.
// @Tags admin
// @Accept json
// @Produce json
// @Security BackendBearer
// @Param body body AdminMailPreviewRequest true "Draft mode, id and form values"
// @Success 200 {object} Envelope[AdminMailPreviewResult]
// @Failure 401 {object} ErrorEnvelope
// @Failure 403 {object} ErrorEnvelope
// @Failure 404 {object} ErrorEnvelope
// @Failure 422 {object} ErrorEnvelope
// @Router /mail/preview [post]
func AdminMailPreview() {}
// AdminMailTestSend documents POST /mail/test-send.
//
// @Summary Send a mail draft to yourself
// @Description Sends an unsaved template, layout or partial draft to the signed-in administrator's own email. Interactive sessions only; recipient fields in the body are refused. Limited to five sends per administrator per ten minutes (429 with Retry-After).
// @Tags admin
// @Accept json
// @Produce json
// @Security BackendBearer
// @Param body body AdminMailPreviewRequest true "Draft mode, id and form values"
// @Success 200 {object} Envelope[AdminMailTestSendResult]
// @Failure 401 {object} ErrorEnvelope
// @Failure 403 {object} ErrorEnvelope
// @Failure 404 {object} ErrorEnvelope
// @Failure 422 {object} ErrorEnvelope
// @Failure 429 {object} ErrorEnvelope
// @Failure 502 {object} ErrorEnvelope
// @Router /mail/test-send [post]
func AdminMailTestSend() {}
// AdminListSchema documents the list schema route.
//
// @Summary Admin list schema