{"id":19319715,"url":"https://github.com/hyperoslo/cellular","last_synced_at":"2025-04-22T17:32:08.226Z","repository":{"id":8367399,"uuid":"9934464","full_name":"hyperoslo/cellular","owner":"hyperoslo","description":"Sending and receiving SMSs with Ruby through pluggable backends.","archived":false,"fork":false,"pushed_at":"2017-05-31T08:36:09.000Z","size":113,"stargazers_count":20,"open_issues_count":3,"forks_count":6,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-13T14:16:33.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperoslo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-08T11:03:01.000Z","updated_at":"2022-04-04T07:35:35.000Z","dependencies_parsed_at":"2022-08-07T04:01:10.935Z","dependency_job_id":null,"html_url":"https://github.com/hyperoslo/cellular","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fcellular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fcellular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fcellular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fcellular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperoslo","download_url":"https://codeload.github.com/hyperoslo/cellular/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223902211,"owners_count":17222330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T01:24:55.049Z","updated_at":"2024-11-10T01:24:55.607Z","avatar_url":"https://github.com/hyperoslo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cellular\n\n[![Gem Version](https://img.shields.io/gem/v/cellular.svg?style=flat)](https://rubygems.org/gems/cellular)\n[![Build Status](https://img.shields.io/travis/hyperoslo/cellular.svg?style=flat)](https://travis-ci.org/hyperoslo/cellular)\n[![Dependency Status](https://img.shields.io/gemnasium/hyperoslo/cellular.svg?style=flat)](https://gemnasium.com/hyperoslo/cellular)\n[![Code Climate](https://img.shields.io/codeclimate/github/hyperoslo/cellular.svg?style=flat)](https://codeclimate.com/github/hyperoslo/cellular)\n[![Coverage Status](https://img.shields.io/coveralls/hyperoslo/cellular.svg?style=flat)](https://coveralls.io/r/hyperoslo/cellular)\n\nSending and receiving SMSs with Ruby through pluggable backends.\n\n**Supported Ruby versions: 2.0.0 or higher**\n\nLicensed under the **MIT** license, see LICENSE for more information.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```\ngem 'cellular'\n```\n\nAnd then execute:\n\n```shell\nbundle\n```\n\nOr install it yourself as:\n\n```shell\ngem install cellular\n```\n\n## Usage\n\n### Configuration\n\n```ruby\nCellular.configure do |config|\n  config.username = 'username'\n  config.password = 'password'\n  config.backend = Cellular::Backends::Sendega\n  config.sender = 'Default custom sender'\n  config.country_code = 'NO'\nend\n```\n\nCellular uses Rails' [ActiveJob](http://edgeguides.rubyonrails.org/active_job_basics.html)\ninterface to interact with queue backends. Read appropriate documentation to set up queue.\n\n\n### Available Backends\n\n* [Cellular::Backends::CoolSMS](http://coolsms.com/)\n* [Cellular::Backends::Sendega](http://sendega.com/)\n* [Cellular::Backends::Twilio](http://twilio.com/)\n* [Cellular::Backends::LinkMobility](https://www.linkmobility.com)\n* Log (logs to `$stdout`)\n* Test (adds messages to `Cellular.deliveries`)\n\n\n### Sending SMSs\n\nThe options supported may differ between backends.\n\n```ruby\nsms = Cellular::SMS.new(\n  recipient: '+47xxxxxxxx', # Valid international format\n  sender: '+370xxxxxxxx',\n  message: 'This is an SMS message',\n  price: 0,\n  country_code: 'NO' # defaults to Cellular.config.country_code\n)\n\nsms.deliver\n```\n\nFor use with multiple recipients in one request use:\n\n```ruby\nsms = Cellular::SMS.new(\n  recipients: ['+47xxxxxxx1','+47xxxxxxx2','+47xxxxxxx3'],\n  sender: '+370xxxxxxxx',\n  message: 'This is an SMS message',\n  price: 0,\n  country_code: 'NO' # defaults to Cellular.config.country_code\n)\n\nsms.deliver\n```\n\n\n#### Delayed SMSs delivery\n\nYou can also send texts asynchronously, which is great if you're in a Rails app\nand are concerned that it might time out or something. To use it, just call\n`deliver_async` instead of `deliver` on the SMS object:\n\n```ruby\nsms = Cellular::SMS.new(\n  recipient: '+47xxxxxxxx',\n  sender: '+47xxxxxxxx',\n  message: 'This is an SMS message'\n)\n\nsms.deliver_async\n```\n\nThis will create a delayed job for you on the **cellular** queue, so make sure\nthat your queue processor is running.\n\nTo override queue name, use **queue** option\n\n```ruby\nsms.deliver_async(queue: :urgent)\n```\nUsing ActiveJob, Cellular allows you to schedule the time when an SMS will be sent.\nJust call `deliver_async(wait_until: timestamp)` or `deliver_async(wait: time)` on the SMS object:\n\n```ruby\nsms = Cellular::SMS.new(\n  recipient: '+47xxxxxxxx',\n  sender: '+47xxxxxxxx',\n  message: 'This is an SMS message'\n)\n\nsms.deliver_async(wait_until: Date.tomorrow.noon)\n```\n\n## Troubleshooting\n\nIf 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.\n\nAlso, make sure phone numbers are in valid international format:\n[`+47xxxxxxxx`, `+370xxxxx`]\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b feature/my-new-feature`)\n3. Write your code and necessary tests\n4. Run your tests (`bundle exec rspec`)\n5. Commit your changes (`git commit -am 'Add some feature'`)\n6. Push to the branch (`git push origin feature/my-new-feature`)\n7. Create pull request and be awesome!\n\n\n## Credits\n\nHyper made this. We're a digital communications agency with a passion for good code,\nand if you're using this library we probably want to hire you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fcellular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperoslo%2Fcellular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fcellular/lists"}