README.md in cellular-2.0.0 vs README.md in cellular-2.1.0

- old
+ new

@@ -34,11 +34,11 @@ ```ruby Cellular.configure do |config| config.username = 'username' config.password = 'password' - config.backend = Cellular::Backends::Sendega + config.backend = Cellular::Backends::Sendega config.sender = 'Default custom sender' config.country_code = 'NO' end ``` @@ -46,24 +46,25 @@ interface to interact with queue backends. Read appropriate documentation to set up queue. ### Available Backends -* [CoolSMS](http://coolsms.com/) -* [Sendega](http://sendega.com/) +* [Cellular::Backends::CoolSMS](http://coolsms.com/) +* [Cellular::Backends::Sendega](http://sendega.com/) +* [Cellular::Backends::Twilio](http://twilio.com/) * Log (logs to `$stdout`) * Test (adds messages to `Cellular.deliveries`) ### Sending SMSs The options supported may differ between backends. ```ruby sms = Cellular::SMS.new( - recipient: '47xxxxxxxx', - sender: 'Custom sender', + recipient: '+47xxxxxxxx', # Valid international format + sender: '+370xxxxxxxx', message: 'This is an SMS message', price: 0, country_code: 'NO' # defaults to Cellular.config.country_code ) @@ -71,12 +72,12 @@ ``` For use with multiple recipients in one request use: ```ruby sms = Cellular::SMS.new( - recipients: ['47xxxxxxx1','47xxxxxxx2','47xxxxxxx3'], - sender: 'Custom sender', + recipients: ['+47xxxxxxx1','+47xxxxxxx2','+47xxxxxxx3'], + sender: '+370xxxxxxxx', message: 'This is an SMS message', price: 0, country_code: 'NO' # defaults to Cellular.config.country_code ) @@ -90,12 +91,12 @@ and are concerned that it might time out or something. To use it, just call `deliver_async` instead of `deliver` on the SMS object: ```ruby sms = Cellular::SMS.new( - recipient: '47xxxxxxxx', - sender: 'Custom sender', + recipient: '+47xxxxxxxx', + sender: '+47xxxxxxxx', message: 'This is an SMS message' ) sms.deliver_async ``` @@ -111,24 +112,33 @@ Using ActiveJob, Cellular allows you to schedule the time when an SMS will be sent. Just call `deliver_async(wait_until: timestamp)` or `deliver_async(wait: time)` on the SMS object: ```ruby sms = Cellular::SMS.new( - recipient: '47xxxxxxxx', - sender: 'Custom sender', + recipient: '+47xxxxxxxx', + sender: '+47xxxxxxxx', message: 'This is an SMS message' ) sms.deliver_async(wait_until: Date.tomorrow.noon) ``` +## Troubleshooting + +If you are using Twilio as a backend, please make sure you add or (port)[https://www.twilio.com/help/faq/porting] a phone number to your account so, that you can use that as a sender option. You won't be able to send messages from any phone number unless you port it to Twilio. + +Also, make sure phone numbers are in valid international format: +[`+47xxxxxx`, `+370xxxxx`] + ## Contributing 1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create pull request +2. Create your feature branch (`git checkout -b feature/my-new-feature`) +3. Write your code and necessary tests +4. Run your tests (`bundle exec rspec`) +5. Commit your changes (`git commit -am 'Add some feature'`) +6. Push to the branch (`git push origin feature/my-new-feature`) +7. Create pull request and be awesome! ## Credits Hyper made this. We're a digital communications agency with a passion for good code,