Skip to content
ahcarpenter edited this page Jul 21, 2012 · 14 revisions

File name: example.rb

require 'referthis'

endpoints = []
endpoints['email_address'] = '[email protected]'
endpoints['phone_number'] = '646-397-6583'

ReferThis.url(endpoints, 1, request.base_url, 'Drew') # attempt transmission of referral via email & SMS
endpoints['phone_number'] = ''

ReferThis.url(endpoints, 1, request.base_url, 'Drew', {:app_name=>'App', :body=>request.base_url + '/'}) # attempt transmission of referral via email
ReferThis.url(endpoints, 1, request.base_url, 'Drew', {:body=>request.base_url + '/'})
endpoints['phone_number'] = '646-397-6583'
endpoints['email_address'] = ''

ReferThis.url(endpoints, 1, request.base_url, 'Drew') # attempt transmission of referral via SMS

ReferThis.clicked_through_rate(true, true) # email, SMS & overall clicked through rate
puts ReferThis.clicked_through_rate(true, true)['email']
puts ReferThis.clicked_through_rate(true, true)['sms']
puts ReferThis.clicked_through_rate(true, true)['overall']
ReferThis.clicked_through_rate(true, true, false) # email & SMS clicked through rate
puts ReferThis.clicked_through_rate(true, true, false)['email']
puts ReferThis.clicked_through_rate(true, true, false)['sms']
ReferThis.clicked_through_rate(true, false) # email & overall clicked through rate
puts ReferThis.clicked_through_rate(true, false)['email']
puts ReferThis.clicked_through_rate(true, false)['overall']
Clone this wiki locally