mmailer 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dd54c25c40ed4293cdff3ec1de42ce503d61a258
4
+ data.tar.gz: 70b24990ecc0c2cc8dae1e5d0fcf76f5fdcba1c6
5
+ SHA512:
6
+ metadata.gz: 99d5301b396aba445eae37ba696e46ddb30900c73e4567a70fd82f879fa1aacc89ff8f7a2e1a0606088cf1ae269948d2c32e957a880d78f84d7680acaf34d304
7
+ data.tar.gz: 72677ae7d8246143e0a5bbc8296edd6a659b570ff3f3b3adf1259088c7a268c795e7b773158cb77cf139c412c6d62555354cda54a71b53d670f71b12d9929fbe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 0.1.0
2
+
3
+ * Exit when from Net::SMTPAuthenticationError
4
+
1
5
  ## Version 0.0.9
2
6
 
3
7
  * Recover from Net::SMTPAuthenticationError
@@ -1,11 +1,16 @@
1
1
  module Mmailer
2
2
  module ErrorHandling
3
+ include Mmailer::Client
3
4
 
4
5
  def try(number_of_times=3)
5
6
  retry_count = 0
6
7
  begin
7
8
  yield
8
- rescue Net::OpenTimeout, Net::ReadTimeout, Net::SMTPAuthenticationError, EOFError => e
9
+ rescue Net::SMTPAuthenticationError => e
10
+ puts "#{e.class}: #{e.message}"
11
+ puts "This is a non-recoverable error. Please check your authentication credentials."
12
+ client(:stop)
13
+ rescue Net::OpenTimeout, Net::ReadTimeout, EOFError => e
9
14
  retry_count += 1
10
15
  puts "#{e.class}: #{e.message}: #{retry_count} retries"
11
16
  sleep retry_count
@@ -29,4 +34,4 @@ module Mmailer
29
34
  end
30
35
 
31
36
  end
32
- end
37
+ end
@@ -17,12 +17,14 @@ module Mmailer
17
17
 
18
18
  def send_email(user)
19
19
 
20
- mail = Mail.new do
21
- to user.email
22
- end
20
+ mail = Mail.new
21
+ mail.to = user.email
23
22
  mail.from = from
24
23
  mail.subject = subject
25
-
24
+ #Defaulting to UTF-8, set your own if this is incorrect.
25
+ mail.charset = 'UTF-8'
26
+ mail.content_transfer_encoding = '8bit'
27
+
26
28
  compiled_source=ERB.new(File.read(Dir.pwd + "/" + Mmailer.configuration.template + ".md.erb")).result(binding)
27
29
 
28
30
  text_part = Mail::Part.new
@@ -34,8 +36,6 @@ module Mmailer
34
36
 
35
37
  mail.text_part = text_part
36
38
  mail.html_part = html_part
37
- #when Non US-ASCII detected and no charset defined. Defaulting to UTF-8, set your own if this is incorrect.
38
- mail.charset = 'UTF-8'
39
39
 
40
40
  case ENV['MMAILER_ENV']
41
41
  when "production"
@@ -47,4 +47,4 @@ module Mmailer
47
47
  end
48
48
  end
49
49
  end
50
- end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Mmailer
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Daniel Szmulewicz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,97 +27,85 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: thor
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: mail
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: micromachine
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: kramdown
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: Bulk mailer with remote control (drb server)
@@ -154,27 +139,26 @@ files:
154
139
  homepage: https://github.com/danielsz/mmailer
155
140
  licenses:
156
141
  - LGPL.v3
142
+ metadata: {}
157
143
  post_install_message:
158
144
  rdoc_options: []
159
145
  require_paths:
160
146
  - lib
161
147
  required_ruby_version: !ruby/object:Gem::Requirement
162
- none: false
163
148
  requirements:
164
- - - ! '>='
149
+ - - '>='
165
150
  - !ruby/object:Gem::Version
166
151
  version: '0'
167
152
  required_rubygems_version: !ruby/object:Gem::Requirement
168
- none: false
169
153
  requirements:
170
- - - ! '>='
154
+ - - '>='
171
155
  - !ruby/object:Gem::Version
172
156
  version: '0'
173
157
  requirements: []
174
158
  rubyforge_project:
175
- rubygems_version: 1.8.23
159
+ rubygems_version: 2.0.14
176
160
  signing_key:
177
- specification_version: 3
161
+ specification_version: 4
178
162
  summary: Bulk mailing the Ruby way
179
163
  test_files:
180
164
  - spec/spec_helper.rb