Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "option" feature #1

Merged
merged 5 commits into from
Apr 11, 2015
Merged

Add "option" feature #1

merged 5 commits into from
Apr 11, 2015

Conversation

danielberkompas
Copy link
Owner

You can now simultaneously add <Say> verbs to Twiml and record those options for future use. For example:

people = Enum.with_index(people)
{opts, xml} = twiml do
  Enum.each people, fn({person, num}) ->
    option num, "Press #{num} for #{person.name}", then: :do_this
  end
end

opts # => [{1, [then: :do_this]}, ...]

This is very useful when combining ExTwiml with a state machine, say, to manage a phone tree.

@danielberkompas danielberkompas changed the title Add option feature Add "option" feature Apr 11, 2015
danielberkompas added a commit that referenced this pull request Apr 11, 2015
@danielberkompas danielberkompas merged commit 25e49c2 into master Apr 11, 2015
@danielberkompas danielberkompas deleted the twiml-with-options branch April 11, 2015 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant