mass_mandrill 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -20,10 +20,13 @@ class ExampleMailer < MassMandrill::MandrillMailer
20
20
  :vars => [{ :name => 'first_name', :content => recipient.first_name }]
21
21
  }
22
22
  end
23
+ template_content = [{ :name => 'header', :content => '<h1>Hello World</h1>'
24
+ }]
23
25
 
24
26
  mail(to: addresses,
25
27
  from: 'John Doe <john.doe@example.com>',
26
28
  subject: 'This is example notice!',
29
+ template_content: template_content,
27
30
  global_merge_vars: global_merge_vars,
28
31
  merge_vars: merge_vars)
29
32
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -2,7 +2,7 @@ require 'mandrill'
2
2
 
3
3
  module MassMandrill
4
4
  class MandrillMail
5
- attr_reader :message
5
+ attr_reader :message, :template_content
6
6
 
7
7
  def initialize(template_name, template_content, message)
8
8
  @template_name = template_name
@@ -1,6 +1,6 @@
1
1
  module MassMandrill
2
2
  class MandrillMailer
3
- attr_reader :message
3
+ attr_reader :message, :template_content
4
4
 
5
5
  def initialize(template_name)
6
6
  @template_name = template_name
@@ -12,7 +12,7 @@ module MassMandrill
12
12
 
13
13
  def mail(options)
14
14
  @message = build_message(options)
15
- @template_content = []
15
+ @template_content = options[:template_content]
16
16
  @template_name = options[:template] if options[:template]
17
17
 
18
18
  MandrillMail.new(@template_name, @template_content, @message)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "mass_mandrill"
8
- s.version = "0.1.1"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Trisignia", "Neboj\u{161}a Stri\u{10d}evi\u{107}"]
12
- s.date = "2013-03-16"
12
+ s.date = "2013-04-18"
13
13
  s.description = "Send Mandrill template emails"
14
14
  s.email = "nebojsa.stricevic@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -4,7 +4,8 @@ describe MassMandrill::MandrillMailer do
4
4
  class DummyMailer < MassMandrill::MandrillMailer
5
5
  def dummy_notification
6
6
  mail(:from => "Example Company <example.company@example.com>",
7
- :global_merge_vars => { :name => 'var1', :content => 'var1_value' })
7
+ :global_merge_vars => { :name => "var1", :content => "var1_value" },
8
+ :template_content => [ { :name => "tc1", :content => "tc1_value" } ])
8
9
  end
9
10
  end
10
11
 
@@ -22,4 +23,6 @@ describe MassMandrill::MandrillMailer do
22
23
  specify { @message[:from_name].should == "Example Company" }
23
24
  specify { @message[:global_merge_vars].should == { :name => 'var1', :content => 'var1_value' } }
24
25
  end
26
+
27
+ specify { @mailer.template_content.should == [ { :name => "tc1", :content => "tc1_value" } ] }
25
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mass_mandrill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-16 00:00:00.000000000 Z
13
+ date: 2013-04-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mandrill-api
17
- requirement: &19146320 !ruby/object:Gem::Requirement
17
+ requirement: &8542400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.0.16
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *19146320
25
+ version_requirements: *8542400
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &19145240 !ruby/object:Gem::Requirement
28
+ requirement: &8541320 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 2.13.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *19145240
36
+ version_requirements: *8541320
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: debugger
39
- requirement: &19144100 !ruby/object:Gem::Requirement
39
+ requirement: &8540560 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.5.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *19144100
47
+ version_requirements: *8540560
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rdoc
50
- requirement: &19143040 !ruby/object:Gem::Requirement
50
+ requirement: &8539920 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 4.0.0
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *19143040
58
+ version_requirements: *8539920
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: jeweler
61
- requirement: &19142120 !ruby/object:Gem::Requirement
61
+ requirement: &8539240 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 1.8.4
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *19142120
69
+ version_requirements: *8539240
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: bundler
72
- requirement: &19141080 !ruby/object:Gem::Requirement
72
+ requirement: &8538660 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: 1.3.3
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *19141080
80
+ version_requirements: *8538660
81
81
  description: Send Mandrill template emails
82
82
  email: nebojsa.stricevic@gmail.com
83
83
  executables: []
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  segments:
118
118
  - 0
119
- hash: 2158431976326342039
119
+ hash: -559060157040125478
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements: