Automation · Content and publishing
Change your Sanity site's opening hours or a price with a WhatsApp message
An AI agent gets the new opening hours or price on WhatsApp, edits the document in Sanity and publishes the change to your site.
How do I change my Sanity page's opening hours or a price without opening the editor?
The owner writes to the Met on WhatsApp something like «from Monday we open at 7» or «the combo now costs 25.000». The Met finds the Sanity project, reads the schema to learn which field holds that value, finds the document with a GROQ query and edits the field. Sanity saves that change in a draft, never straight to published content. The Met checks the draft and publishes it: at that point the new value moves into the published content your site shows. If the admin turned off the publish action, the change stays in draft for someone on the team to review and publish from Sanity Studio.
What starts it
When the customer writes
It starts when the owner or someone on the team writes to the Met on WhatsApp with the change they want on the site. There is no trigger to configure: the Met handles it in that conversation.
Nothing to set up. The Met assigned to that channel picks up the conversation and runs the procedure inside it.
Who runs it
Content Met that keeps the site up to date in Sanity
Social team
This is not a named, seeded Met. It is a Met that serves the team, not customers, with Sanity connected: its work ends when the new value is published on the site or, if publishing is off, when the draft is ready for review.
Run by the content and social Met
Channels: WhatsApp
What you need connected
- Sanity Automate and collaborate
6 steps · 6 tools
The procedure, step by step
Each step shows the tool that runs. They belong to the real connector: if one of them stopped existing, this page would not build.
- 1
Find the site's project
The Met lists the Sanity projects of the connected account and picks the site's, using the name the skill gives. If the account has a single project, it uses that one.
- 2
Learn which field holds the value
The Met gets the project's deployed schema to learn which document type stores branches or products and what the opening hours or price field is called.
- 3
Find the document
With a GROQ query, the Met looks for the branch or product the owner named and asks only for the fields it needs, such as the name, the opening hours or the current price.
- 4
Edit the field in a draft
The Met edits the field with the new value. Sanity saves the edit in the document's draft, never straight to published content, so the site does not change yet.
- 5
Check the draft
The Met opens the draft by its ID and checks that the field holds the value the owner asked for, before publishing.
- 6
Publish the change
The Met publishes the draft and the new value moves into the published content your site shows. It tells the owner what changed. If the admin turned this action off, it says the draft is waiting for review in Sanity Studio.
Before you start
What you need ready
The Met solves none of these for you. If one is missing, the automation stops there.
-
Sanity connected with editing on
In Met, open Connections → Sanity → Connect and sign in with an account that can edit and publish in the site's project. The admin decides whether publishing stays on.
-
A Met that serves only your team
Connect Sanity on a Met your team uses, not on the one that serves customers: the Met does not check by itself who is writing, and anyone talking to it could ask for a change.
-
Document and field names in the skill
Write in the skill instructions which document type stores branches or products and what the opening hours and price fields are called, so the Met does not guess.
The limits
What this automation does NOT solve
Better said here than discovered halfway through the rollout.
-
It does not rebuild your site: if your site only picks up new content when it is deployed again, the change shows up on the next deploy.
-
It does not ask you for confirmation in the chat before editing or publishing. If you want to review each change, turn off the publish action and publish yourself from Sanity Studio.
-
It does not change images or files: this procedure only edits text or number fields in a document.
-
It does not tell who is writing. That is why it goes on a team Met and not on the customer line.
FAQ
Questions about this automation
The GROQ query returns both. Tell it in the skill that, when there is more than one result, it should ask the owner which one it is instead of editing the first.
Yes: send it the previous value and the Met edits the field again and publishes. Unpublishing does not work for this, because it takes the whole document out of published content.
Yes, editing accepts up to 25 documents per call. For a large price change, it is best to review the draft before publishing it.
Keep going
Other automations built on the same tools
Content and publishing
Build with Brandfetch the brand kit of the client who sends their website on WhatsApp
How do I gather a new client's logo, colors and brand voice without asking for each one on WhatsApp?
Customer service
- Starts:
- when the customer writes
- Steps:
- 5, with 5 real tools
- Needs:
- Brandfetch
Content and publishing
Build an Unsplash collection of photos similar to the reference a client sends you
How do I find photos similar to the one a client sent me as a reference for their campaign?
Customer service
- Starts:
- when the customer writes
- Steps:
- 6, with 6 real tools
- Needs:
- Unsplash
Content and publishing
Put together an ad's voiceover and music on WhatsApp with Epidemic Sound
How do I get licensed voice and music for an ad without hiring a studio?
Studio
- Starts:
- when someone asks for it
- Steps:
- 5, with 6 real tools
- Needs:
- Epidemic Sound
Content and publishing
Build a promotion landing page in Leadpages from WhatsApp
How do I build a promotion landing page in Leadpages without leaving WhatsApp?
Social
- Starts:
- when someone asks for it
- Steps:
- 6, with 6 real tools
- Needs:
- Leadpages
Want this automation running on your own data?
We will show it to you with your accounts connected, not with a canned demo.