Repository navigation
Description
Summary
People write and optimize pages in the Content Editor, then copy the HTML by hand into their site. This issue proposes a Send to CMS flow from the editor and the Library. The page lands in the customer's CMS as a draft: Ansvisor never publishes on its own (spec v2 §6). The published URL comes back to Ansvisor, so the draft becomes Published and tracking starts (CE-013).
The plan is in two phases.
- Webhook first. We already have a webhook for Content Opportunities, so this reuses it. It reaches every CMS on day one: directly for self-hosted sites, and through Zapier / Make / n8n for the rest.
- Native connectors after that, by demand: WordPress, then Webflow. Shopify and Wix come later.
What exists today (to reuse)
| Piece | Where | Reuse |
|---|---|---|
| Webhook configs per brand: URL, secret, subscribed events | webhook_configs, 00198 (events with an allow-list constraint) |
Add a new event, content_draft.sent (new migration to extend the constraint) |
| Settings UI with event checkboxes | web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx, allowed events in web/src/lib/actions/content.ts |
Add the event's checkbox and copy |
| Delivery | server/src/lib/webhook-dispatch.js dispatchBrandWebhook(brandId, payload): X-Webhook-Secret header, 15 s timeout, sent/failed counts |
Send the content package with it |
| Send-route pattern | server/src/routes/content.js (opportunity.sent: no_webhook / webhook_not_subscribed errors, payload building) |
Same checks and error codes for drafts |
| Callback from the workflow | server/src/routes/webhook-content-callback.js: POST /webhooks/content/:id/status, per-secret and failed-auth rate limits, webhookSecretsMatch |
A sibling route for drafts that reports the CMS item id and published URL |
| Publishable HTML | publishableHtml (Copy HTML), sanitizeDraftHtml |
Stored body_html is untrusted (see #1259's review), so always send the sanitized, publishable version |
Phase 1: webhook (estimate 1–2 PRs)
- Content package. One JSON shape for every target:
event: "content_draft.sent",sentAt;draft:id,title,slug(from the title, editable later),metaTitle,metaDescription,html(publishable, sanitized),jsonLd[],pageType,method(create / optimize),sourceUrl(the page being optimized),language;brand:id,name, primary domain;callback:{ url, method: "POST" }for reporting back.- Version the shape (
schemaVersion: 1) so templates don't break later.
- Send from the editor. A Send to CMS button in the header. Before sending, save what's waiting (autosave settle). Show "Sent · {date}" afterwards, with "Send again".
- Send from the Library. "Send to CMS" in the row menu (feat(content): archive, delete and set a status from the Library's rows #1328) and as a bulk action on selected rows. One delivery per draft. Cap the batch size.
- Delivery record per draft. A new table, e.g.
content_draft_deliveries:draft_id,target(webhooknow, connector names later),status(sent / failed / published),external_id,published_url,sent_at,sent_by,error. It drives the "Sent" state, retries, and the Library filter. - Callback route.
POST /webhooks/content-drafts/:id/statuswith{ status: "published" | "failed", externalId?, url? }, authenticated by the webhook secret like the opportunity callback. A published URL:- sets the draft to Published and stores
published_url; - keeps a
publishversion in History (00215); - starts tracking (CE-013).
- sets the draft to Published and stores
- Guides and templates. Short docs plus ready-made Zapier / Make / n8n templates, e.g. "Ansvisor webhook → create a draft post": WordPress, Webflow CMS item, Shopify blog article, Wix draft post, Framer CMS (via Make). Each one calls the callback with the CMS item's URL.
Phase 2: native connectors (one PR each, by demand)
Every connector implements the same small interface, send(package, connection) → { externalId, url, status }, and writes the same delivery record. Shared rules:
- Drafts only: create or update as a draft in the CMS.
- Idempotent: a draft that already has an
external_idfor that target updates the item instead of creating a second one. - HTML the target accepts. Webflow's rich text has no tables, so convert tables or move them to an embed. Wix stores Ricos JSON, not HTML.
- JSON-LD where the target takes it: a Webflow custom-code field, a WordPress plugin or custom HTML block, a Shopify metafield / theme.
- Images wait for workspace files (CHAT-06); until then they aren't sent.
| CMS | Route | Notes |
|---|---|---|
| WordPress (first) | Direct REST API + Application Passwords (site URL, user, app password). No OAuth app or app review | Composio's toolkit only covers WordPress.com and Jetpack-connected sites, and only draft posts. Most business sites are self-hosted, so call the REST API directly (posts and pages, status: draft) |
| Webflow (second) | Composio (server/src/lib/composio.js already runs managed connections and tools.execute for Search Console / Analytics) with API-key auth (site token) |
Tools exist: WEBFLOW_CREATE_COLLECTION_ITEM, WEBFLOW_UPDATE_COLLECTION_ITEM, WEBFLOW_UPDATE_PAGE_METADATA. Needs a field-mapping step (collection + fields: name, slug, body, meta) |
| Shopify (later) | Composio, OAuth only | Composio has no managed OAuth app for Shopify, so we register our own Shopify app. Create article / page tools exist; an update tool wasn't visible in the docs, so check before relying on it. Align with the e-commerce "Push to Shopify" work (SHOP-009) so there's one Shopify connection |
| Wix (later) | Composio, OAuth or API key | Blog draft tools to be confirmed; needs HTML → Ricos conversion |
| Framer | Webhook / Make | No Composio toolkit seen; CMS writes go through Framer's plugin / API model. Research before building |
Note: none of these toolkits has a Composio-managed OAuth app. OAuth means registering our own app per CMS (with reviews on Shopify / Wix). API-key auth (Webflow, Wix) avoids that for a first version.
Security and permissions
- Who can send: admins and managers (proposal), as for other org-wide writes. The Library bulk action follows the same rule.
- Secrets: CMS credentials and API keys live in Composio (connectors) or encrypted server-side (WordPress app passwords). They are never sent to the browser or logged.
- The callback route is public by design: rate-limited, secret-checked and constant-time compared, mirroring the opportunity callback.
- The webhook URL is the brand's own setting, as today. Native connectors call only the CMS's API host.
Open questions
- Who can send to a CMS: admins and managers, or every member?
- Slug and meta: derived automatically (title, first paragraph), or editable fields in the editor before sending?
- Bulk limit for the Library (e.g. 25 per send)?
- Order of native connectors after the webhook: WordPress → Webflow → Shopify → Wix?
- Should "Send to CMS" also exist on Action Center content tasks (feat(content): link Action Center writing tasks and Content Editor drafts both ways #1306)?
Out of scope
- Publishing live from Ansvisor: the CMS keeps the publish step.
- Image upload (CHAT-06).
- Two-way sync of later edits made in the CMS.
Related
CE-013 (Published state and tracking), CE-021 (export), SHOP-009 (Push to Shopify), 00198 (webhook event subscriptions), 00215 (History), #1328 (Library row menu).
Activity
cihan-gyk commentedon Oct 21, 2026
Decisions (2026-10-22) on the open questions:
Phase 1 (webhook) can start once you're OK with the plan.
gkhngyk commentedon Oct 23, 2026
Thanks, the plan looks good:
Go ahead with phase 1 (webhook).
fix(content): keep a draft's live address server-side (Send to CMS an…
cihan-gyk commentedon Oct 24, 2026
Scope note for phase 1 (from the #1439 review):
content_draft_last_deliveries(00262).POST /webhooks/content-drafts/:deliveryId/statuswith{ status: "published" | "failed", url?, externalId?, reason? }.fix(content): post a bulk send's next request once the last one's pag…
feat(content): send Content Editor pages to the brand's webhook as co…
feat(content): send a Content Editor page to the brand's webhook from…
feat(content): send a Library page to the CMS from its row, and show …
feat(content): send the Library's selected pages to the CMS together …
docs(content): document Send to CMS and the content_draft.sent webhoo…
docs(content): say when a page sent to Webflow becomes Published (Sen…
feat(content): connect a brand's Webflow site for Send to CMS (Send t…
feat(content): send Content Editor pages to the brand's Webflow colle…
feat(settings): connect a brand's Webflow site, collection and fields…
feat(content): pick Webflow or the webhook when sending pages to the …
13 remaining items
feat(cms): send pages to a brand's Framer collection as draft items (#…
feat(cms): mark a page published once its Framer item is live on the …
feat(cms): connect a brand's Framer project from Settings › Integrati…
feat(cms): send pages to Framer from Send to CMS (#1331) (#1580)
docs(content): document sending pages to Framer as draft items (Send …
fix(settings): say Framer's set-up isn't finished until a collection …
feat(cms): connect a brand's Wix site with its owner's API key and se…
feat(cms): connect a brand's Wix site from Settings › Integrations an…
feat(cms): mark a page published once its Wix post is live, read when…
docs(content): document sending pages to Wix as draft posts (Send to …
gkhngyk commentedon Nov 26, 2026
Closing this as done. Everything planned here has shipped on
main:content_draft.sentevent, the delivery callback, and the Library's last-send filter.HubSpot was added later in #2271. New targets get their own issues, such as Ghost in #2157.