lachie / merb_mail_queue

Plugin that provides mail queueing functionality on top of merb-mailer

This URL has Read+Write access

merb_mail_queue / README
100644 39 lines (29 sloc) 1.25 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
merb_mail_queue
===============
 
A plugin for the Merb framework that provides mail queueing functionality.
Instead of sending emails right away, this plugin queues them into database
table and provides simple processor that loads queue and does send out in the
background.
 
Setup
===============
 
Add dependencies in your init file like this:
 
dependencies "merb-mailer", "merb_mail_queue"
 
 
Set up configuration and load plugin in after_app_loads hook. This plugin has
two configuration options: adapter name (only ActiveRecord is supported at the moment)
and mail queue job model class name. So it may look like this in the end.
 
Queue processor assumed to use your application mailer configuration.
 
Merb::BootLoader.after_app_loads do
  Merb::Plugins.config[:merb_mail_queue] = {
    :mail_queue_job_model_class_name => "MailQueueJob",
    :adapter => :activerecord
  }
  
  Merb::MailQueue.load_plugin!
  
  Merb::Mailer.config = {
    :host => 'mail.your-domain.com',
    :port => '25',
    :user => 'webmaster',
    :pass => 'supersecret',
    :auth => :plain, # :plain, :login, :cram_md5, the default is no auth
    :domain => "your-domain.com" # the HELO domain provided by the client to the server
  }
end