The Mobile Mail List is a combined Rails 2.2 and Voxeo Tropo application designed to allow retail establishments a method of
collecting cell phone numbers from customers in order to track purchases, send them mobile coupons, etc. The application is
written in Ruby, and the voice script is written in a DSL called Tropo Tropo is really cool
because you can write one script and it can handle voice, SMS and IM interactions using the same dialog.
For instance, the heart of this application’s script is very simple:
answer wait 1000 caller_id = $currentCall.callerID log “Accepting a call from #{caller_id}” say "Thanks for calling #{COMPANY_NAME} #{SLOGAN}. We will enter your mobile phone in our database, and you are now eligible to receive a discount off of our products \ and to receive periodic coupons to your cell phone for special deals." if is_phone(caller_id) result = ask “Are you calling from the mobile phone you want to register? You must be able to receive text messages to redeem coupons.”, yes_no_options if result.name == “choice” and result.value == “no” then caller_id = nil end end until is_phone(caller_id) log “Asking for a valid phone number.” result=ask ‘Please enter the 10 digit U.S. phone number you would like to register.’, phone_number_options log result.inspect caller_id = result.value end log “Adding #{caller_id} to the mobile mail list.” res = Net::HTTP.post_form(URI.parse(‘https://mobilemaillist.heroku.com/subscribers.xml’), {"subscriber[site_id]" => SITE_ID.to_s, “subscriber[callerid]” => caller_id}) say "Thanks for signing up for our preferred customer program. You will receive exclusive savings offers to your mobile \ phone, and receive ten percent off all future purchases. Thanks for shopping at #{COMPANY_NAME}. Good bye!" hangupInstall
This version of the application runs on Heroku, but you can run it anywhere you want. This set of instructions
only applies to Heroku – a more general version of the installation will come.
- Download and unzip Bort
- Edit the database.yml and the settings.yml files
- Changed the default password in the bort migration
- Edit the REST_AUTH_SITE_KEY in each of the environment files
- Rake db:migrate
- Have a brew and celebrate