Smsfly
Welcome!
This Ruby gem helps You to send SMS using API https://sms-fly.com/
TODO:
Installation
Add this line to your application's Gemfile:
gem 'smsfly', '~> 0.4.6'
And then execute:
$ bundle
Or install it yourself as:
$ gem install smsfly
Then run:
$ rails g smsfly:config
which will generate default settings files:
config/initializers/smsfly.rb
Then configurate smsfly.rb file:
Smsfly.configuration do |config|
config.login = 'You login'
config.password = 'You password'
end
Or another method
module YouApp
class Application < Rails::Application
ENV['SMS_FLY_USER'] = 'You login'
ENV['SMS_FLY_PASS'] = 'Your password'
end
end
Smsfly.configuration do |config|
config.login = ENV['SMS_FLY_USER']
config.password = ENV['SMS_FLY_PASS']
end
Test connection to API:
Smsfly.authentication?
true
false
Get your balance:
Smsfly.balance
Float object(like "6.177" ,"5.655")
false
Usage
TODO:
For show you login and password run:
$ rails c
$ Smsfly.connect_info
If the file smsfly.rb is set up correctly
You can send a test message to your own login/phone
Smsfly.test_sms('You random text')
To send a message to other numbers, use
Smsfly.send_sms(text, recipient , description , source)
Add campaignID
log_obj - object where we write campaignID
log_filed - campaignID feld
history = HistoryItem.new()
history.save
Smsfly.send_sms(text, recipient , description , source , {:log_obj => history, :log_filed => 'campaign_id'} )
Smsfly.send_sms(text, recipient , description , source , options = {} )
Development
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Serhii-Danovsky/smsfly. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.