adzap-ar_mailer 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ = 2.0.1
2
+
3
+ * Added option to use smtp setting of :tls => false to disable TLS auto start in Ruby 1.8.7+
4
+ * Removed some cruft which can be handled by ActiveSupport
5
+
1
6
  = 2.0.0
2
7
 
3
8
  * Removed need to use ARMailer subclass. Just set the delivery method and you are ready to go. Backwards compatible with a deprecation notice if you subclass old ARMailer class.
@@ -104,6 +104,16 @@ See <tt>ar_sendmail -h</tt> for full details.
104
104
  If you want to set the ActiveRecord model that emails will be stored in,
105
105
  see ActionMailer::Base.email_class=
106
106
 
107
+ === A word on TLS
108
+
109
+ If you are using Ruby 1.8.7 or above TLS will be enabled automatically if your
110
+ SMTP server supports it. If you do not want it to automatically enabled then
111
+ set the :tls option to false in your smtp_settings.
112
+
113
+ If you on Ruby 1.8.6 or less then the TLS patch included in this plugin will
114
+ be loaded, so you don't need another TLS plugin to add the capability. This
115
+ patch allows you to explicit set if the server supports TLS by setting the
116
+ :tls option to true in your smtp_settings.
107
117
 
108
118
  === Help
109
119
 
@@ -15,21 +15,11 @@ end
15
15
 
16
16
  class ActionMailer::Base
17
17
 
18
- @@email_class = Email
19
-
20
- ##
21
- # Current email class for deliveries.
22
-
23
- def self.email_class
24
- @@email_class
25
- end
26
-
27
18
  ##
28
- # Sets the email class for deliveries.
29
-
30
- def self.email_class=(klass)
31
- @@email_class = klass
32
- end
19
+ # Set the email class for deliveries.
20
+ #
21
+ cattr_accessor :email_class
22
+ self.email_class = Email
33
23
 
34
24
  ##
35
25
  # Adds +mail+ to the Email table. Only the first From address for +mail+ is
@@ -37,10 +27,8 @@ class ActionMailer::Base
37
27
 
38
28
  def perform_delivery_activerecord(mail)
39
29
  mail.destinations.each do |destination|
40
- @@email_class.create :mail => mail.encoded, :to => destination,
41
- :from => mail.from.first
30
+ self.class.email_class.create :mail => mail.encoded, :to => destination, :from => mail.from.first
42
31
  end
43
32
  end
44
33
 
45
34
  end
46
-
@@ -3,14 +3,6 @@ require 'net/smtp'
3
3
  require 'smtp_tls' unless Net::SMTP.instance_methods.include?("enable_starttls_auto")
4
4
  require 'rubygems'
5
5
 
6
- class Object # :nodoc:
7
- unless respond_to? :path2class then
8
- def self.path2class(path)
9
- path.split(/::/).inject self do |k,n| k.const_get n end
10
- end
11
- end
12
- end
13
-
14
6
  ##
15
7
  # Hack in RSET
16
8
 
@@ -54,7 +46,7 @@ class ActionMailer::ARSendmail
54
46
  ##
55
47
  # The version of ActionMailer::ARSendmail you are running.
56
48
 
57
- VERSION = '2.0.0'
49
+ VERSION = '2.0.1'
58
50
 
59
51
  ##
60
52
  # Maximum number of times authentication will be consecutively retried
@@ -415,7 +407,7 @@ end
415
407
 
416
408
  @batch_size = options[:BatchSize]
417
409
  @delay = options[:Delay]
418
- @email_class = Object.path2class options[:TableName]
410
+ @email_class = options[:TableName].constantize
419
411
  @once = options[:Once]
420
412
  @verbose = options[:Verbose]
421
413
  @max_age = options[:MaxAge]
@@ -449,7 +441,7 @@ end
449
441
 
450
442
  smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
451
443
  if smtp.respond_to?(:enable_starttls_auto)
452
- smtp.enable_starttls_auto
444
+ smtp.enable_starttls_auto unless smtp_settings[:tls] == false
453
445
  else
454
446
  settings << smtp_settings[:tls]
455
447
  end
@@ -1,4 +1,6 @@
1
1
  require 'test/unit'
2
+ require 'rubygems'
3
+ require 'active_support'
2
4
  require 'action_mailer'
3
5
  require 'action_mailer/ar_mailer'
4
6
 
@@ -663,4 +663,3 @@ Last send attempt: Thu Aug 10 11:40:05 %s 2006
663
663
  end
664
664
 
665
665
  end
666
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adzap-ar_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-03-12 00:00:00 -07:00
13
+ date: 2009-04-12 00:00:00 -07:00
14
14
  default_executable: ar_sendmail
15
15
  dependencies: []
16
16