Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunny/action_mailer_auto_url_options
Make ActionMailer use the current request host and protocol for URL generation
https://github.com/sunny/action_mailer_auto_url_options
Last synced: about 1 month ago
JSON representation
Make ActionMailer use the current request host and protocol for URL generation
- Host: GitHub
- URL: https://github.com/sunny/action_mailer_auto_url_options
- Owner: sunny
- License: mit
- Created: 2014-07-11T13:31:28.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-01-17T14:37:44.000Z (10 months ago)
- Last Synced: 2024-10-09T22:04:39.362Z (about 1 month ago)
- Language: Ruby
- Homepage:
- Size: 54.7 KB
- Stars: 17
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
ActionMailer automatic URL options
==================================Make ActionMailer use the current request host, port and protocol for URL
generation.Why?
----In Rails apps, if you create links in your emails, you need to set the
host, port and protocol in every environment configuration file you use.This plugin removes that need by using the current request's host, port and
protocol instead.This is also helpful when you use different domain names, based on the language
for example.Install
-------Add these lines to your Rails application's Gemfile:
```ruby
# Add the current request host and protocol in email URLs
gem "action_mailer_auto_url_options"
```Run `bundle install`, restart your server and that's it!
Usage with Sidekiq
------------------If you delay your emails with Sidekiq, include this middleware in
`config/initializers/sidekiq.rb`:```ruby
require "action_mailer_auto_url_options/middleware/sidekiq"
```License
-------MIT
Development
-----------Clone this project, then install dependencies with:
```sh
$ bundle
```And launch tests with:
```sh
$ bundle exec rspec
```