diff --git a/openapi.yaml b/openapi.yaml
index 0ee51c4..1dbf0ac 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -1631,6 +1631,83 @@ paths:
$ref: '#/components/responses/ForbiddenError'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
+ /feature_launches/email_preview:
+ post:
+ tags: [Feature Launches]
+ summary: Preview the feature launch email
+ description: |
+ Gives the feature launch email for up to 10 feature launches, as one person would get it, without sending
+ anything: the subject, the HTML and the plain-text version. It is the email the weekly and one-off feature
+ launch emails send, and the same as Site Overview › Feature launches › Preview email shows.
+
+ Send `user_email` to see it as that Makerble user gets it: a deep link ("Open Registers") and Take the tour
+ show only when their account can open the page. Leave it out to see it as someone without a Makerble account,
+ who gets the User Guide and blog links instead. The launches appear in the order of `feature_launch_ids`.
+ System Access users (Makerble staff) only. Anyone else gets 403.
+ operationId: previewFeatureLaunchEmail
+ security: [{tokenAuth: []}]
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FeatureLaunchEmailInput'
+ example:
+ feature_launch_ids: [12, 9]
+ user_email: someone@example.org
+ intro: Here is what we released this month.
+ responses:
+ "200":
+ description: The email as that person would get it
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FeatureLaunchEmailPreview'
+ "401":
+ $ref: '#/components/responses/Unauthorized'
+ "403":
+ $ref: '#/components/responses/ForbiddenError'
+ "422":
+ $ref: '#/components/responses/UnprocessableEntityList'
+ /feature_launches/email_test:
+ post:
+ tags: [Feature Launches]
+ summary: Send yourself a test of the feature launch email
+ description: |
+ Sends the feature launch email, as `user_email` (or someone without an account) would get it, to you and no
+ one else. The subject starts "[Test]". Takes the same input as POST /feature_launches/email_preview.
+ System Access users (Makerble staff) only. Anyone else gets 403.
+ operationId: sendFeatureLaunchEmailTest
+ security: [{tokenAuth: []}]
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FeatureLaunchEmailInput'
+ example:
+ feature_launch_ids: [12]
+ responses:
+ "200":
+ description: The test is on its way
+ content:
+ application/json:
+ schema:
+ type: object
+ required: [message, to]
+ properties:
+ message:
+ type: string
+ example: Test sent to you@makerble.com.
+ to:
+ type: string
+ description: The address it was sent to, always your own.
+ "401":
+ $ref: '#/components/responses/Unauthorized'
+ "403":
+ $ref: '#/components/responses/ForbiddenError'
+ "422":
+ $ref: '#/components/responses/UnprocessableEntityList'
/feature_launches/{id}:
parameters:
- name: id
@@ -19663,6 +19740,39 @@ components:
type: integer
skipped_by_system:
type: integer
+ FeatureLaunchEmailInput:
+ type: object
+ required: [feature_launch_ids]
+ properties:
+ feature_launch_ids:
+ type: array
+ description: The feature launches to show, 1 to 10, in this order (from GET /feature_launches).
+ items:
+ type: integer
+ user_email:
+ type: string
+ description: Show it as this Makerble user gets it. Leave it out for someone without a Makerble account.
+ intro:
+ type: string
+ description: An opening paragraph, shown before the feature launches.
+ subject:
+ type: string
+ description: The subject. Leave it out to name the features ("What’s new in Makerble - Registers and Albums").
+ FeatureLaunchEmailPreview:
+ type: object
+ required: [subject, to, html, text]
+ properties:
+ subject:
+ type: string
+ to:
+ type: string
+ description: Who it would go to.
+ html:
+ type: string
+ description: The HTML version, a 600px email with inline styles.
+ text:
+ type: string
+ description: The plain-text version.
FeatureLaunch:
type: object
description: A feature launch and its launch content
diff --git a/server.js b/server.js
index f12fcd6..d77f88b 100644
--- a/server.js
+++ b/server.js
@@ -4818,6 +4818,16 @@ function buildDocsPage() {
{ code: "404", cls: "response-4xx", desc: "Not found" },
{ code: "422", cls: "response-4xx", desc: "Validation failed" }
], "Only the fields sent change; null or an empty string clears one. jira_keys and email_text_links replace the whole list. A new email_image replaces the saved one, and changing email_visual away from image removes it.")}
+ ${endpointCard("POST", "/feature_launches/email_preview", "Preview the feature launch email", true, [], [
+ { code: "200", cls: "response-2xx", desc: "subject, to, and the html and plain-text (text) versions. Nothing is sent" },
+ { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" },
+ { code: "422", cls: "response-4xx", desc: "No feature launches, more than 10, one that doesn't exist, or no user with that email address" }
+ ], "The feature launch email (the email that tells people about new features) for up to 10 launches, as one person gets it. Body: feature_launch_ids (required, in the order to show them), user_email (see it as that Makerble user; leave it out for someone without an account), intro (an opening paragraph), subject (leave it out to name the features). Links into Makerble, such as Open Registers and Take the tour, show only for a user whose account can open them; everyone else gets the User Guide and blog links.")}
+ ${endpointCard("POST", "/feature_launches/email_test", "Send yourself a test of the feature launch email", true, [], [
+ { code: "200", cls: "response-2xx", desc: "message and to: the test is on its way to you" },
+ { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" },
+ { code: "422", cls: "response-4xx", desc: "As for the preview" }
+ ], "Sends the email from Preview the feature launch email to you and no one else, with a subject starting [Test]. Takes the same body.")}