Skip to content

Instantly share code, notes, and snippets.

@bastienbot
Last active August 2, 2020 09:11
Show Gist options
  • Save bastienbot/f857e64213025313beda442d456468bc to your computer and use it in GitHub Desktop.
Save bastienbot/f857e64213025313beda442d456468bc to your computer and use it in GitHub Desktop.
start:
say "Hi, let's subscribe to an awesome newsletter 💌 !"
// Starting event should go here
goto firstname
firstname:
say "What's your firstname?"
hold
remember firstname = event
// First flow event
goto lastname
lastname:
say "What's your lastname?"
hold
remember lastname = event
// Second flow event
goto email
email:
say "What's your email address?"
hold
if (!event.contains("@")) {
say "Please enter a valid email address"
goto email
}
remember email = event
// Third flow event
goto save
save:
do Fn("zapier",
hook="myhook/myhookid",
payload={
"firstname": firstname,
"lastname": lastname,
"email": email
}
)
say "Ok **{{firstname}} {{lastname}}**, I have registered your email **{{email}}** to our newsletter!"
say "Enjoy the great content 🎉"
// Ending event
goto end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment