axtro-ar_mailer 2.1.6 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,29 +3,19 @@
3
3
  # ActionMailer.
4
4
  #
5
5
 
6
- class ActionMailer::Base
7
-
8
- ##
9
- # Set the email class for deliveries. Handle class reloading issues which prevents caching the email class.
10
- #
11
- @@email_class_name = 'Email'
12
-
13
- def self.email_class=(klass)
14
- @@email_class_name = klass.to_s
15
- end
16
-
17
- def self.email_class
18
- @@email_class_name.constantize
6
+ class ARMailer
7
+
8
+ def initialize(options)
9
+ self.email_class = options[:email_class] || Email
19
10
  end
20
-
21
- ##
22
- # Adds +mail+ to the Email table. Only the first From address for +mail+ is
23
- # used.
24
-
25
- def perform_delivery_activerecord(mail)
26
- mail.destinations.each do |destination|
27
- self.class.email_class.create :mail => mail.encoded, :to => destination, :from => mail.from.first
11
+
12
+ attr_accessor :email_class_name, :email_class
13
+
14
+ def deliver!(mail)
15
+ destinations = mail.destinations
16
+ sender = mail.return_path || mail.sender || mail.from_addrs.first
17
+ destinations.each do |destination|
18
+ self.email_class.create :mail => mail.encoded, :to => destination, :from => sender
28
19
  end
29
20
  end
30
-
31
21
  end
@@ -42,7 +42,7 @@ class ActionMailer::ARSendmail
42
42
  ##
43
43
  # The version of ActionMailer::ARSendmail you are running.
44
44
 
45
- VERSION = '2.1.6'
45
+ VERSION = '2.2.0'
46
46
 
47
47
  ##
48
48
  # Maximum number of times authentication will be consecutively retried
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: axtro-ar_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 2
8
+ - 0
9
+ version: 2.2.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Eric Hodel
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2009-11-11 00:00:00 +01:00
18
+ date: 2010-08-28 00:00:00 +02:00
14
19
  default_executable: ar_sendmail
15
20
  dependencies: []
16
21
 
@@ -54,21 +59,25 @@ rdoc_options:
54
59
  require_paths:
55
60
  - lib
56
61
  required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
57
63
  requirements:
58
64
  - - ">="
59
65
  - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
60
68
  version: "0"
61
- version:
62
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
63
71
  requirements:
64
72
  - - ">="
65
73
  - !ruby/object:Gem::Version
74
+ segments:
75
+ - 0
66
76
  version: "0"
67
- version:
68
77
  requirements: []
69
78
 
70
79
  rubyforge_project: seattlerb
71
- rubygems_version: 1.3.5
80
+ rubygems_version: 1.3.7
72
81
  signing_key:
73
82
  specification_version: 3
74
83
  summary: A two-phase delivery agent for ActionMailer