Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/railsware/actionmailer-balancer
A Ruby gem to send your ActionMailer mail through one of several delivery methods, selected by weight.
https://github.com/railsware/actionmailer-balancer
actionmailer mail ruby ruby-gem ruby-on-rails
Last synced: about 3 hours ago
JSON representation
A Ruby gem to send your ActionMailer mail through one of several delivery methods, selected by weight.
- Host: GitHub
- URL: https://github.com/railsware/actionmailer-balancer
- Owner: railsware
- License: mit
- Created: 2022-10-04T08:36:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T10:10:45.000Z (11 days ago)
- Last Synced: 2024-10-31T14:16:33.667Z (8 days ago)
- Topics: actionmailer, mail, ruby, ruby-gem, ruby-on-rails
- Language: Ruby
- Homepage:
- Size: 63.5 KB
- Stars: 98
- Watchers: 19
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ActionMailer Balancer
This gem allows you to send your ActionMailer mail through one of several delivery methods, selected by weight.
Applications:
- gradually migrate to a new mail provider (first 1% of mail, then 5%, and so on)
- ...or to a new configuration (SMTP to Email API)
- spread load between multiple providersWorks with any valid ActionMailer delivery methods, either built-in or added from a library like [mailtrap](https://github.com/railsware/mailtrap-ruby#actionmailer).
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'actionmailer-balancer'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install actionmailer-balancer
## Usage
Add the configuration to Rails env initializer
```ruby
Your::Application.configure do
config.action_mailer.delivery_method = :balancer
config.action_mailer.balancer_settings = {
delivery_methods: [
{
method: :smtp,
settings: {
user_name: username,
password: password,
address: host,
domain: domain,
port: port,
authentication: auth_method
},
weight: 90
},
{
method: :sendmail,
settings: {
location: '/path/to/your/sendmail'
},
weight: 10
}
]
}
end
```Now, just use ActionMailer as usual, and mail will be auto-balanced.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. 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`.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/railsware/actionmailer-balancer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/railsware/actionmailer-balancer/blob/master/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the ActionMailer::Balancer project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/railsware/actionmailer-balancer/blob/master/CODE_OF_CONDUCT.md).