say "Hi 🤓, I just need a few informations in order to add you to my mailing list."
say "What's your firstname?"
remember nlFirstname = event
title = "I don't want to share my lastname",
accept = ["No", "No", "no", "NA", "N/A", "na", "n/a"]
say Question(title="What's your lastname?", buttons=[btnLastname])
if (event.match(btnLastname)) remember nlLastname = "N/A"
else remember nlLastname = event
say "What's your email address?"
// does the user's input look like an email address?
// otherwise the input is probably not a valid email address
// we need to ask them again
say "That's not a valid email address 😱"
say "How did you like this newsletter onboarding?"
do sapcaiResponse = App("sap/cai", text=event)
// this contains the sentiment analysis of the query
say sapcaiResponse.results.sentiment
if (Find("positive", in=sapcaiResponse.results.sentiment)) {
say "Thank you so much for your kind words 😇."
else if (Find("negative", in=sapcaiResponse.results.sentiment)) {
say "I'd love to know what went wrong, please join our slack channel and let us know."
say "I am sure you'll get to love CSML :D"
// prepare the arguments required by the mailchimp app
"firstname": nlFirstname,
do mailchimpResponse = App("mailchimp", action="subscribeToList", options=options)
say "I have added you to our newsletter subscription list !"