github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

mdarby / mq

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 68
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (1)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • v0.1.3
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

An email queue that actually works — Read more

  cancel

http://blog.matt-darby.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

README textile => markdown 
mdarby (author)
Wed Dec 16 17:27:00 -0800 2009
commit  884b28cf887a9a087bbcc199cc45fc42952f8f95
tree    b5c512146d0dd5dcec2333ac77a67de01afe4c8d
parent  0480fe7189a0244df7bbcd2e1ea79115dd386b52
mq /
name age
history
message
file .document Wed Dec 16 17:02:59 -0800 2009 Migrated to Jeweler [mdarby]
file .gitignore Wed Dec 16 17:02:59 -0800 2009 Migrated to Jeweler [mdarby]
file LICENSE Wed Dec 16 17:02:59 -0800 2009 Migrated to Jeweler [mdarby]
file README.markdown Wed Dec 16 17:27:00 -0800 2009 README textile => markdown [mdarby]
file Rakefile Wed Dec 16 17:18:30 -0800 2009 Updated Jeweler task and regenerated gemspec [mdarby]
file VERSION Wed Dec 16 17:02:59 -0800 2009 Migrated to Jeweler [mdarby]
directory generators/ Sun Oct 18 07:40:25 -0700 2009 Added long forgotten spec [mdarby]
directory lib/ Wed Feb 11 17:03:05 -0800 2009 Initial commit [mdarby]
file mq.gemspec Wed Dec 16 17:18:30 -0800 2009 Updated Jeweler task and regenerated gemspec [mdarby]
directory test/ Wed Dec 16 17:02:59 -0800 2009 Migrated to Jeweler [mdarby]
README.markdown

mq

A Rails gem that generates an MVC stack that does email queuing

What it does

mq is a generator that generates an MVC stack for queuing emails. It has a UI too. I got tired of dealing with crappy email queuing systems in Rails, so I wrote my own.

Requirements

None.

How to Install

sudo gem install mq -s http://gemcutter.com

How to Use

Assuming you'd like to name your mq table Email, and your Mailer model is named Notifier

Generate the files necessary for your app:

./script/generate mq Email Notifier

mq requires your Mailer methods accept an email address as its first parameter, so a Mailer method should look like:

Notifier.send_email_method(email_address)

Of course, you can pass as many parameters as you'd like:

Notifier.send_email_method(email_address, some_object, some_other_object, ...)

Queue an email by calling Email.queue with the name of your Notifier method as the first parameter, and the recipient email address as the second parameter, followed by anything else you'd like to pass.

Email.queue(:send_email_method, "matt@matt-darby.com")

You can pass multiple email addresses to the Email.queue method and mq will automatically generate individual emails for the recipients.

Email.queue(:send_email_method, ["matt@matt-darby.com", "foo@bar.com"], ...)

Delivery of queued email

You can create a cronjob (this on runs every five minutes)

/5    * cd /path/to/your/app && ./script/runner/Email.deliver_all

How to Test

Complete Rspec specs are included automatically. Well, complete aside from view specs as you'll just change the damned things anyway.

About the Author

My name is Matt Darby. I’m an IT Manager and pro-web-dev at for Dynamix Engineering and hold a Master’s Degree in Computer Science from Franklin University in sunny Columbus, OH.

Feel free to check out my site or recommend me

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server