Skip to content
This repository was archived by the owner on Oct 8, 2026. It is now read-only.
timimsmsPublic archive

About

Superseded by https://github.com/timimsms/smswire. Archived; kept for history.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ActionMessenger

⚠️ This project is superseded and archived.

The idea behind ActionMessenger has moved to Smswire (https://smswire.dev): the production SMS layer for Rails that Noticed and twilio-ruby both leave to you. Smswire covers messenger classes and templates, provider adapters, persisted deliveries with status callbacks, consent and STOP/HELP/START handling, retries, development sandboxing, previews, and test helpers, plus a Noticed delivery adapter.

This repository is kept for history only. It was never published to rubygems.org, its dependencies are years end-of-life, and it does not install on current Ruby. No further changes will be made here.

ActionMessenger provides a lightweight comparative solution for text messages (SMS) creation and delivery as ActionMailer provides for email composition and delivery in the core Rails API.

⚠️ Gem is currently pre-release! ⚠️

The following tasks are mapped to the initial release:

  • Ability to manage ENV variable for an application using this Gem.
  • Ability to process and sent text messages via Twilio.
  • Ability to set per-Messenger-instance defaults.
  • Create generators for the installation of this Gem as well as the generation of each new Messenger instance.
  • Ensure that the message(...) call is returning an object which can then receive specific delivery method to trigger the SMS delivery. This will allow deliver_now and deliver_later functionality for SMS.
  • Ability to set application-wide Messenger defaults.
  • TESTS!!!
  • Better/updated documentation showcasing all of the initial functionality.

Installation

Ruby

Add this line to your application's Gemfile:

gem 'actionmessenger'

And then execute:

bundle

Or install it yourself as:

gem install actionmessenger

Rails

The latest version of Action Messenger can be installed with RubyGems:

https://rubygems.org/gems/actionmessenger

Simply add the following to your Gemfile:

gem 'actionmessenger'

And then run bundle install in your project's root directory directory.

Usage

Sending Text Messages

require 'action_messenger'

class TestMessenger < ActionMessenger::Base
  default from: ENV['TWILIO_PHONE_NUMBER']

  def self.send_test(to:)
    message(to: to, body: 'TEST')
  end
end

Which would allow a very basic text message containing the word "TEST" when running:

TestMessenger.send_test(to: '+15551234567')

TODO: Update this once we are pulling in the text from app/views. - TW

Generating new Messengers

TODO: Fill out this section once we have basic generators.

Setting Defaults

Similar to ActionMailer, the Base class maintains a class-level attribute which stores default values used in the message delivery configuration.

For a new Messenger instance, a default value could be provided using the following syntax:

class TommyTutoneMessenger < ActionMessenger::Base
  default from: '+15558675309'
  .....
end

Application Configuration

TODO: Look to review how defaults would be set in a new Rails app. - TW

Development

After checking out the repository, you may:

  • run bin/setup to install dependencies,
  • run bundle exec rspec spec to run the tests, and
  • 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/timimsms/actionmessenger.

License

ActionMessenger is provided as open source software under the MIT license.

About

Superseded by https://github.com/timimsms/smswire. Archived; kept for history.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages