Contents:
Register for an account on cmtelecom.com and you will be provided with a TOKEN (e.g. 00000000-0000-0000-0000-000000000000) for authentication.
Add the following to Gemfile and run bundle install.
gem 'cm-sms', github: 'jagdeepsingh/cm-sms', ref: 'a7a25460838e1eeb09578e8f3d1ab3cc27ba1534'Set the product token.
CmSms.config.product_token = TOKENDefine a class for sending SMS.
# app/services/sms_notifier.rb
class SmsNotifier < CmSms::Messenger
def sms(from, to, body, reference)
content(from: from,
to: to,
body: body,
reference: reference)
end
endSmsNotifier.sms(SENDER, MOBILE_NUMBER, SMS_BODY, UNIQUE_REFERENCE).deliver_nowMOBILE_NUMBER should be a mobile number in the format 00919512345678 or +919512345678, where 91 is country code followed by 10-digit mobile number 9512345678.