Last active
August 2, 2020 09:11
-
-
Save bastienbot/f857e64213025313beda442d456468bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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