mad_mimi_mailer 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ module MadMimiMailable
40
40
  end
41
41
 
42
42
  module ClassMethods
43
- attr_accessor :method_prefix
43
+ attr_accessor :method_prefix, :use_erb
44
44
 
45
45
  def method_missing(method_symbol, *parameters)
46
46
  if method_prefix && method_symbol.id2name.match(/^deliver_(#{method_prefix}_[_a-z]\w*)/)
@@ -56,7 +56,7 @@ module MadMimiMailable
56
56
  mail = new
57
57
  mail.__send__(method, *parameters)
58
58
 
59
- if mail.use_erb
59
+ if use_erb?(mail)
60
60
  mail.create!(method, *parameters)
61
61
  end
62
62
 
@@ -90,7 +90,7 @@ module MadMimiMailable
90
90
 
91
91
  params['unconfirmed'] = '1' if mail.unconfirmed
92
92
 
93
- if mail.use_erb
93
+ if use_erb?(mail)
94
94
  if mail.parts.any?
95
95
  params['raw_plain_text'] = content_for(mail, "text/plain")
96
96
  params['raw_html'] = content_for(mail, "text/html") { |html| validate(html.body) }
@@ -154,6 +154,10 @@ module MadMimiMailable
154
154
  raise "Please provide a String or an Array for recipients or bcc."
155
155
  end
156
156
  end
157
+
158
+ def use_erb?(mail)
159
+ mail.use_erb || use_erb
160
+ end
157
161
  end
158
162
 
159
163
  end
@@ -5,7 +5,7 @@ require "net/https"
5
5
  require "mad_mimi_mailable"
6
6
 
7
7
  class MadMimiMailer < ActionMailer::Base
8
- VERSION = '0.1.1'
8
+ VERSION = '0.1.2'
9
9
 
10
10
  @@api_settings = {}
11
11
  cattr_accessor :api_settings
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dave Hoover