https://github.com/queueclassic/qc-mailer
Send email in the background using QueueClassic
https://github.com/queueclassic/qc-mailer
Last synced: about 1 year ago
JSON representation
Send email in the background using QueueClassic
- Host: GitHub
- URL: https://github.com/queueclassic/qc-mailer
- Owner: QueueClassic
- Created: 2012-08-14T16:13:10.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-03-20T20:35:32.000Z (about 12 years ago)
- Last Synced: 2025-03-28T23:51:14.499Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 188 KB
- Stars: 7
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
QueueClassic Mailer
===================
Add to a Rails 3.x project to send email in the background using QueueClassic.
This gem was inspired by ResqueMailer, https://github.com/zapnap/resque_mailer
**WARNING: USE AT OWN RISK! THIS GEM IS CONSIDERED EXTREME ALPHA!**
[](http://travis-ci.org/zerobearing2/qc-mailer)
[](https://codeclimate.com/github/zerobearing2/qc-mailer)
Usage
-----
Install as gem
gem install qc-mailer
Add to Gemfile
gem "qc-mailer"
Include QC::Mailer in your ActionMailer subclass(es) like this:
```ruby
class MyMailer < ActionMailer::Base
include QC::Mailer
end
```
Now, when ```MyMailer.subject_email(params).deliver``` is called, an entry will be created in the job queue.
Note that you can still have mail delivered synchronously by using the bang method variant:
```ruby
MyMailer.subject_email(params).deliver!
```
If you want to set a different default queue name for your mailer, you can change the default_queue property like so:
```ruby
# config/initializers/qc_mailer.rb
QC::Mailer.default_queue = 'application_specific_mailer'
```
Development
-----------
To get a working development environment, do the following;
```bash
git clone https://github.com/rainforestapp/qc-mailer.git
cd qc-mailer
bundle
createdb queue_classic_test
rake
```
TODO
----
- TBD
Meta
----
Released under the [MIT license](http://www.opensource.org/licenses/mit-license.php).