delayed_mailer 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README +56 -0
- data/VERSION +1 -0
- data/delayed_mailer.gemspec +7 -2
- data/spec/delayed_mailer_spec.rb +2 -1
- metadata +7 -5
- data/VERSION.yml +0 -5
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Anderson Dias
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
DelayedJobMailer
|
2
|
+
==============
|
3
|
+
|
4
|
+
This plugin provides a module which - when included into an ActionMailer subclass - pushes all emails that would
|
5
|
+
normally be delivered synchronously into a queue for asynchronous processing. For queuing it relies on the delayed_job
|
6
|
+
plugin ( http://github.com/tobi/delayed_job ).
|
7
|
+
|
8
|
+
How it works
|
9
|
+
============
|
10
|
+
|
11
|
+
The plugin provides a module Delayed::Mailer. To make a mailer use a queue simply include it into the class like this:
|
12
|
+
|
13
|
+
class MyMailer < ActionMailer::Base
|
14
|
+
include Delayed::Mailer
|
15
|
+
end
|
16
|
+
|
17
|
+
From now on all MyMailer.deliver_whatever_email calls create an entry delayed_job queue.
|
18
|
+
If you still want to deliver mail sycnhronously add a bang to the method call: MyMailer.deliver_whatever_email!
|
19
|
+
|
20
|
+
To set asynchronous mailing as project default, you need to create an initializer file as follows:
|
21
|
+
|
22
|
+
# config/initializers/delayed_mailer.rb
|
23
|
+
class ActionMailer::Base
|
24
|
+
include Delayed::Mailer
|
25
|
+
end
|
26
|
+
|
27
|
+
Installation
|
28
|
+
============
|
29
|
+
|
30
|
+
script/plugin install git://github.com/andersondias/delayed_job_mailer.git
|
31
|
+
|
32
|
+
Configuration
|
33
|
+
=============
|
34
|
+
|
35
|
+
Delayed e-mails is an awesome thing in production environments, but for e-mail specs/tests in testing environments it can be a mess causing specs/tests to fail because the e-mail haven't been sent directly. Therefore you can configure what environments that should be excluded like so:
|
36
|
+
|
37
|
+
# config/initializers/delayed_mailer.rb
|
38
|
+
|
39
|
+
Delayed::Mailer.excluded_environments = [:test, :cucumber] # etc.
|
40
|
+
|
41
|
+
...
|
42
|
+
|
43
|
+
Credits
|
44
|
+
=======
|
45
|
+
|
46
|
+
This plugin is a delayed job plugin based on langalex workling_mailer
|
47
|
+
plugin that can be found at http://github.com/langalex/workling_mailer
|
48
|
+
|
49
|
+
Contact
|
50
|
+
=======
|
51
|
+
|
52
|
+
Copyright (c) 2009 Anderson Dias, released under the MIT license
|
53
|
+
|
54
|
+
Email: andersondaraujo[at]gmail.com
|
55
|
+
Twitter: extendsmymind
|
56
|
+
Blog: http://extendsmymind.wordpress.com
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/delayed_mailer.gemspec
CHANGED
@@ -5,17 +5,22 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{delayed_mailer}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "1.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Anderson Ara\303\272jo"]
|
12
12
|
s.date = %q{2010-03-05}
|
13
13
|
s.description = %q{Send emails asynchronously using delayed_job.}
|
14
14
|
s.email = %q{andersondaraujo@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README"
|
17
|
+
]
|
15
18
|
s.files = [
|
16
19
|
".gitignore",
|
20
|
+
"MIT-LICENSE",
|
21
|
+
"README",
|
17
22
|
"Rakefile",
|
18
|
-
"VERSION
|
23
|
+
"VERSION",
|
19
24
|
"delayed_mailer.gemspec",
|
20
25
|
"lib/delayed/mailer.rb",
|
21
26
|
"lib/delayed_mailer.rb",
|
data/spec/delayed_mailer_spec.rb
CHANGED
metadata
CHANGED
@@ -3,10 +3,10 @@ name: delayed_mailer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
+
- 1
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.1
|
9
|
+
version: 1.0.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Anderson Ara\xC3\xBAjo"
|
@@ -37,12 +37,14 @@ executables: []
|
|
37
37
|
|
38
38
|
extensions: []
|
39
39
|
|
40
|
-
extra_rdoc_files:
|
41
|
-
|
40
|
+
extra_rdoc_files:
|
41
|
+
- README
|
42
42
|
files:
|
43
43
|
- .gitignore
|
44
|
+
- MIT-LICENSE
|
45
|
+
- README
|
44
46
|
- Rakefile
|
45
|
-
- VERSION
|
47
|
+
- VERSION
|
46
48
|
- delayed_mailer.gemspec
|
47
49
|
- lib/delayed/mailer.rb
|
48
50
|
- lib/delayed_mailer.rb
|