This recipe creates a sender inbox, sends the first email, creates call and SMS playbooks for follow-up, rents a number, and uses the same sender number for the later call and text.
Set the lead email, phone number, and the area code to use for the outbound number search.
export LEAD_EMAIL="[email protected]"
export LEAD_PHONE="+19175550456"
export AREA_CODE="415"Create an inbox address, then send the initial demo follow-up email from that address.
SALES_INBOX=$(spix --json email inbox create \
--username sales \
--name "Spix Sales" \
| jq -r '.data.address')
spix --json email send \
--sender "$SALES_INBOX" \
--to "$LEAD_EMAIL" \
--subject "Following up on your demo request" \
--body "Hi, I saw you requested a demo. I would be happy to find 30 minutes to walk you through the product. What does your Thursday look like?"Use a call playbook for the live conversation and an SMS playbook for the final text touch.
CALL_PLAYBOOK_ID=$(spix --json playbook create \
--type call \
--name "Demo follow-up" \
--goal "Connect with the lead, understand their use case, and schedule a demo." \
--persona "Friendly, consultative sales rep" \
| jq -r '.data.playbook_id')
SMS_PLAYBOOK_ID=$(spix --json playbook create \
--type sms \
--name "Demo follow-up texts" \
--use-case customer_care \
| jq -r '.data.playbook_id')Rent the first returned number, bind it to the call playbook during purchase, then add the SMS binding.
SENDER_NUMBER=$(spix --json phone rent --area-code "$AREA_CODE" --limit 1 | jq -r '.data[0].number')
spix --json phone rent \
--number "$SENDER_NUMBER" \
--bind-channel call \
--bind-playbook "$CALL_PLAYBOOK_ID" \
--confirm
spix --json phone bind "$SENDER_NUMBER" \
--channel sms \
--playbook "$SMS_PLAYBOOK_ID"Create the call session, then send the short follow-up text from the same number.
CALL_SESSION_ID=$(spix --json call create "$LEAD_PHONE" \
--playbook "$CALL_PLAYBOOK_ID" \
--sender "$SENDER_NUMBER" \
| jq -r '.data.session_id')
spix --json sms send "$LEAD_PHONE" \
--sender "$SENDER_NUMBER" \
--playbook "$SMS_PLAYBOOK_ID" \
--body "Hi, just checking if you got my email about the demo. Happy to find a time that works. No pressure."Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.