Skip to content

Instantly share code, notes, and snippets.

if registration?
if supports_automatic_registrations?
if contact_information_valid?
if registration_complete?
toggle!(:processed)
else
return false
end
else
...
require 'active_resource'
class TextMessage < ActiveResource::Base
self.site = "http://api.esendex.com/"
self.user = "XXX@ultraspeed.com"
self.password = "XXX"
ESENDEX_API_REFERENCE = "XXX"
class << self
# Method to send a message using Esendex's new RESTful
# API.
#
# Most people would think to use Builder to build
# the XML for this request. However, Builder seems to
# escape the XML in a way that Esendex doesn't under-
# stand. I will be asking them more about this
# later!
#
def send_using_esendex