From f3a8e125d2da29215eb5f893553a9397dd121094 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 23:21:59 +0000 Subject: [PATCH] Document the weekly email of feature announcements API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CP-9273. The six API v2 endpoints behind Site Overview › Weekly email: get and change a week's email, preview it as a user gets it, Approve and send, change how it is sent, and list the weeks. In openapi.yaml (Weekly Email tag) and as endpoint cards in server.js. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrYYMngkqhxgyRUjaa --- openapi.yaml | 291 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 48 +++++++++ 2 files changed, 339 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index c3236bf..3eb9399 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -211,6 +211,8 @@ tags: description: Guided tours of Makerble's own pages for new colleagues; Organisation Admins choose each team's stops, wording and how strict they are, and see who has finished - name: Feature Launches description: One record per Makerble feature holding its launch content, used by announcements and the feature launch emails; written by Makerble staff + - name: Weekly Email + description: The weekly email of feature announcements, prepared and approved by Makerble staff - name: Feature Tours description: Short tours introducing one feature to people who already use Makerble, offered from a page's Intro or an announcement; written by Makerble staff - name: Staff Unavailability @@ -2004,6 +2006,225 @@ paths: $ref: '#/components/responses/ForbiddenError' "422": $ref: '#/components/responses/UnprocessableEntityList' + /weekly_feature_email: + get: + tags: [Weekly Email] + summary: Get a week's weekly email of feature announcements + description: | + The weekly email of feature announcements for one week (Monday to Sunday), as on Site Overview › Weekly email: + its items (feature launches) in order, subject, opening paragraph, whether it is paused, when it sends, and once + sent, when and to how many people. Without `week`, the coming week's: this week's until it has been sent, then + next week's. A week's email is made the first time it is asked for, filled with the feature launches of + Makerble's announcements that start that week. + + Each person gets only the items whose announcement they are in the audience of. Contacts with a login, Survey + Portal users and people who turned it off in Notification settings get nothing, and a week with no items sends + nothing. System Access users (Makerble staff) only. Anyone else gets 403. + operationId: getWeeklyFeatureEmail + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/WeeklyEmailWeek' + responses: + "200": + description: The week's email and how the weekly email is sent + content: + application/json: + schema: + $ref: '#/components/schemas/WeeklyFeatureEmailWithSetting' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + patch: + tags: [Weekly Email] + summary: Change a week's weekly email + description: | + Changes a week's email, as Site Overview › Weekly email does. Only what you send changes. + `feature_launch_ids` is the whole list of items, in order: launches left out are removed (and stay removed + when the week fills again from new announcements) and new ones are added. `paused: true` stops it sending until + it is resumed. A week that has been sent, or is over, can't change (422). System Access users only. + operationId: updateWeeklyFeatureEmail + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + week: + type: string + format: date + description: Any date in the week. Without it, the coming week's email. + feature_launch_ids: + type: array + maxItems: 10 + items: { type: integer } + description: Every item, in order (see GET /feature_launches) + subject: + type: string + maxLength: 150 + description: Leave empty to name the features + intro: + type: string + maxLength: 1000 + description: An opening paragraph + paused: + type: boolean + example: + week: '2026-12-07' + feature_launch_ids: [12, 9] + intro: Here's what's new in Makerble this week. + responses: + "200": + description: The week's email, after the change + content: + application/json: + schema: + $ref: '#/components/schemas/WeeklyFeatureEmailWithSetting' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /weekly_feature_email/preview: + post: + tags: [Weekly Email] + summary: Preview a week's weekly email as a chosen user gets it + description: | + The week's email as one user would get it, sending nothing: only the items whose announcement they are in the + audience of, with their name and their unsubscribe link. Without `user_email`, your own. If they would get + nothing, `gets_email` is false and `left_out` says why. System Access users only. + operationId: previewWeeklyFeatureEmail + security: [{tokenAuth: []}] + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + week: + type: string + format: date + description: Any date in the week. Without it, the coming week's email. + user_email: + type: string + description: Whose email to show. Without it, your own. + example: + week: '2026-12-07' + user_email: busi@example.com + responses: + "200": + description: The email as that user gets it, or why they get none + content: + application/json: + schema: + $ref: '#/components/schemas/WeeklyFeatureEmailPreview' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /weekly_feature_email/approve: + post: + tags: [Weekly Email] + summary: Approve and send a week's weekly email + description: | + Approve and send, as on Site Overview › Weekly email: records that you approved the week's email, resumes it if + it was paused and sends it straight away. With Send once approved, the email goes only once someone does this. + A week with no items, or one already sent, returns 422. System Access users only. + operationId: approveWeeklyFeatureEmail + security: [{tokenAuth: []}] + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + week: + type: string + format: date + description: Any date in the week. Without it, the coming week's email. + example: + week: '2026-12-07' + responses: + "200": + description: The week's email, now sent + content: + application/json: + schema: + $ref: '#/components/schemas/WeeklyFeatureEmailWithSetting' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /weekly_feature_email/setting: + patch: + tags: [Weekly Email] + summary: Change how the weekly email is sent + description: | + Send automatically (`send_mode: automatic`) sends each week's email on its day and hour, unless it is paused. + Send once approved (`send_mode: approval`) waits until someone approves it. `send_day` is 1 (Monday) to 7 + (Sunday) and `send_hour` 0 to 23, in UK time. Only what you send changes. System Access users only. + operationId: updateWeeklyFeatureEmailSetting + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + send_mode: { type: string, enum: [automatic, approval] } + send_day: { type: integer, minimum: 1, maximum: 7 } + send_hour: { type: integer, minimum: 0, maximum: 23 } + example: + send_mode: approval + responses: + "200": + description: How the weekly email is sent, after the change + content: + application/json: + schema: + $ref: '#/components/schemas/WeeklyFeatureEmailSetting' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /weekly_feature_emails: + get: + tags: [Weekly Email] + summary: List weekly emails + description: | + Every week's email that has been made, newest week first, with when each was sent and to how many people. + System Access users only. + operationId: listWeeklyFeatureEmails + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' + responses: + "200": + description: Paginated weekly emails + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedWeeklyFeatureEmails' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' /feature_launches/{id}: parameters: - name: id @@ -24325,6 +24546,14 @@ components: schema: type: integer description: The Organisation (Charity) ID + WeeklyEmailWeek: + name: week + in: query + required: false + description: Any date in the week (weeks start on Monday). Without it, the coming week's email. + schema: + type: string + format: date Page: name: page in: query @@ -26045,6 +26274,68 @@ components: - type: string format: binary - $ref: '#/components/schemas/AnnouncementImageUpload' + WeeklyFeatureEmail: + type: object + description: One week's weekly email of feature announcements (Site Overview › Weekly email) + properties: + week_starts_on: { type: string, format: date, description: The Monday the week starts on } + week_ends_on: { type: string, format: date } + status: { type: string, enum: [open, sent] } + editable: { type: boolean, description: False once it has been sent or its week is over } + paused: { type: boolean } + subject: { type: string, nullable: true, description: Empty to name the features } + intro: { type: string, nullable: true, description: The opening paragraph } + send_at: { type: string, format: date-time, nullable: true, description: When it sends automatically; null once sent } + waiting_for_approval: { type: boolean, description: True while it needs Approve and send before it can go } + approved_at: { type: string, format: date-time, nullable: true } + approved_by_id: { type: integer, nullable: true } + sent_at: { type: string, format: date-time, nullable: true } + recipients_count: { type: integer, description: How many people it was sent to } + items: + type: array + description: The feature launches it shows, in order + items: + type: object + properties: + feature_launch_id: { type: integer } + name: { type: string } + position: { type: integer } + source: { type: string, enum: [announcement, added], description: From the week's announcements, or added by someone } + updated_at: { type: string, format: date-time } + WeeklyFeatureEmailSetting: + type: object + description: How the weekly email is sent + properties: + send_mode: { type: string, enum: [automatic, approval] } + send_day: { type: integer, description: 1 (Monday) to 7 (Sunday) } + send_hour: { type: integer, description: 0 to 23 } + time_zone: { type: string, example: Europe/London } + WeeklyFeatureEmailWithSetting: + allOf: + - $ref: '#/components/schemas/WeeklyFeatureEmail' + - type: object + properties: + setting: + $ref: '#/components/schemas/WeeklyFeatureEmailSetting' + PaginatedWeeklyFeatureEmails: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/WeeklyFeatureEmail' + WeeklyFeatureEmailPreview: + type: object + properties: + to: { type: string } + gets_email: { type: boolean } + left_out: { type: string, nullable: true, description: Why they get no email, when gets_email is false } + subject: { type: string, nullable: true } + feature_launch_ids: { type: array, items: { type: integer }, description: The items they get } + html: { type: string, nullable: true } + text: { type: string, nullable: true } PaginatedFeatureLaunches: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index 2f30914..68dd9dc 100644 --- a/server.js +++ b/server.js @@ -1007,6 +1007,7 @@ function buildDocsPage() { POSTWishlist POSTWelcome Tours POSTFeature Launches + POSTWeekly Email POSTFeature Tours POSTTraining Materials GETTraining Tours @@ -6122,6 +6123,53 @@ function buildDocsPage() { + +
+
Integrations
+

Weekly Email

+
+

The weekly email of feature announcements, as on Site Overview › Weekly email. Each week (Monday to Sunday) has one email, filled automatically with the feature launches of Makerble's own announcements that start that week. Makerble staff can add, remove and reorder its items, write a subject and an opening paragraph, pause it, preview it as a chosen user gets it, and Approve and send it. A setting says whether it sends automatically on its day and hour (UK time, default Monday 10:00) or only once approved.

+

Each person gets only the items whose announcement they are in the audience of (its roles, audience and behaviour rules, as for the popup). Contacts with a login, Survey Portal users and people who turned it off in Notification settings get nothing, and a week with no items sends nothing. A week is named by week, any date in it (2026-12-07); without it, the coming week's email: this week's until it has been sent, then next week's. System Access users (Makerble staff) only; anyone else gets 403.

+
+
+ ${endpointCard("GET", "/weekly_feature_email", "Get a week's weekly email", true, [ + { name: "week", type: "string", required: false, desc: "Any date in the week (YYYY-MM-DD). Leave out for the coming week" } + ], [ + { code: "200", cls: "response-2xx", desc: "The week's email: status (open or sent), editable, paused, subject, intro, send_at, waiting_for_approval, items in order (feature_launch_id, name, position, source), sent_at, recipients_count, and setting" }, + { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }, + { code: "422", cls: "response-4xx", desc: "week isn't a date" } + ], "A week's email is made the first time it is asked for.")} + ${endpointCard("PATCH", "/weekly_feature_email", "Change a week's weekly email", true, [], [ + { code: "200", cls: "response-2xx", desc: "The week's email, after the change" }, + { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }, + { code: "422", cls: "response-4xx", desc: "A feature launch that doesn't exist, more than 10, a paused that isn't true or false, or a week that has been sent or is over" } + ], "Body: week, feature_launch_ids (every item, in order; launches left out are removed and stay removed when the week fills again), subject (up to 150; empty to name the features), intro (up to 1000), paused. Only what you send changes.")} + ${endpointCard("POST", "/weekly_feature_email/preview", "Preview a week's weekly email as a user gets it", true, [], [ + { code: "200", cls: "response-2xx", desc: "to, gets_email, and either subject, feature_launch_ids, html and text, or left_out saying why they get none. Nothing is sent" }, + { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }, + { code: "422", cls: "response-4xx", desc: "No user with that email address" } + ], "Body: week, user_email (leave it out to see your own). Shows only the items that user gets, with their name and unsubscribe link.")} + ${endpointCard("POST", "/weekly_feature_email/approve", "Approve and send a week's weekly email", true, [], [ + { code: "200", cls: "response-2xx", desc: "The week's email, now sent" }, + { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }, + { code: "422", cls: "response-4xx", desc: "No items, or already sent or over" } + ], "Body: week. Records that you approved it, resumes it if paused, and sends it to everyone who gets it straight away.")} + ${endpointCard("PATCH", "/weekly_feature_email/setting", "Change how the weekly email is sent", true, [], [ + { code: "200", cls: "response-2xx", desc: "send_mode, send_day, send_hour and time_zone" }, + { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }, + { code: "422", cls: "response-4xx", desc: "A mode, day or hour that doesn't exist" } + ], "Body: send_mode (automatic or approval), send_day (1 Monday to 7 Sunday), send_hour (0 to 23, UK time). Only what you send changes.")} + ${endpointCard("GET", "/weekly_feature_emails", "List weekly emails", true, [ + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Records per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 incremental sync" } + ], [ + { code: "200", cls: "response-2xx", desc: "Paginated weekly emails, newest week first" }, + { code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" } + ])} +
+
+
Integrations