Instructions
Workflow Overview
Execute this skill when the user requests to collect feedback from customers with completed purchases. The skill orchestrates a multi-step process involving WooCommerce, Google Forms, and email systems.
Step-by-Step Execution
1. Retrieve Completed Orders
- •Use the
woocommerce-woo_orders_listtool to fetch all orders with status "completed". - •Set
perPageto 100 (or adjust based on expected volume). - •Extract the JSON response containing order details.
2. Locate Requirements File
- •Check for a feedback form requirements file in the workspace.
- •Common filenames:
form_requirement.md,form_requirements.md,feedback_spec.md. - •If not found, list the workspace directory to identify the correct file.
- •Read the requirements file to understand the survey structure.
3. Create Google Form
- •Use
google_forms-create_formwith the title specified in requirements. - •Note: Only the title can be set during creation; description and items are added separately.
- •Capture the returned
formIdandresponderUrifor later use.
4. Add Survey Questions
Based on the requirements file, add questions using appropriate Google Forms tools:
- •Multiple choice questions: Use
google_forms-add_multiple_choice_question - •Text questions: Use
google_forms-add_text_question - •Star ratings: Implement as multiple choice with descriptive options (e.g., "1 star - Very dissatisfied" to "5 stars - Very satisfied")
- •Set
requiredfield according to specifications.
5. Extract Customer Emails
- •Parse the WooCommerce orders JSON to extract unique customer email addresses.
- •Each order contains billing information with
emailfield. - •Note: Some customers may have multiple completed orders; deduplicate emails.
- •Extract customer names from
billing.first_nameandbilling.last_namefor personalization.
6. Send Personalized Invitations
- •For each unique customer email:
- •Use
emails-send_emailtool - •Subject: "We Value Your Feedback - Customer Shopping Experience Survey"
- •Body: Personalized greeting using customer name, thank them for their purchase, include the survey link (
responderUri), and polite closing. - •Send individually to maintain personalization.
- •Use
7. Store Form Reference
- •Save the Google Drive link to a workspace file (e.g.,
drive_url.txt). - •Format:
https://drive.google.com/open?id={formId} - •Use
filesystem-write_fileto create/update the file.
Error Handling
- •If requirements file not found: List directory contents and try common variations.
- •If form creation fails: Check error message and adjust parameters.
- •If email sending fails: Continue with remaining emails and note the failure.
Completion
- •After all steps complete, provide a summary including:
- •Number of completed orders processed
- •Number of unique customers contacted
- •Google Form ID and URL
- •Location of stored drive link
- •Claim completion using
local-claim_done.