mandrill_mailer 0.0.7 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,7 +6,10 @@ Only template based emails are supported at this time.
6
6
  Add `gem 'mailchimp'`
7
7
  Add `gem 'mandrill_mailer'` to your Gemfile
8
8
 
9
- Add this to your `mail.rb` in initializers:
9
+ Add this to your `mail.rb` in initializers.
10
+ You don't need to add the ActionMailer stuff unless your still using ActionMailer emails.
11
+ This just plugs into the Mandrill smtp servers. If your doing template based emails
12
+ through the Mandrill api you really only need the `MandrillMailer.configure` part
10
13
 
11
14
  ```
12
15
  ActionMailer::Base.smtp_settings = {
@@ -34,7 +37,7 @@ in your environment config files:
34
37
  Creating a new Mandrill Mailer is similar to a normal Rails mailer:
35
38
 
36
39
  ```
37
- class InvitationMailer < MandrillMailer::TransactionalMailer
40
+ class InvitationMailer < MandrillMailer::TemplateMailer
38
41
  default from: 'support@example.com'
39
42
 
40
43
  def invite(invitation)
@@ -57,7 +57,7 @@
57
57
  # from address will be used instead.
58
58
 
59
59
  module MandrillMailer
60
- class TransactionalMailer
60
+ class TemplateMailer
61
61
  # include Rails.application.routes.url_helpers
62
62
  include ActionView::Helpers::NumberHelper
63
63
 
@@ -1,3 +1,3 @@
1
1
  module MandrillMailer
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'action_view'
2
2
  require 'mandrill_mailer/railtie'
3
3
  require 'mandrill_mailer/mock'
4
- require 'mandrill_mailer/transactional_mailer'
4
+ require 'mandrill_mailer/template_mailer'
5
5
  require 'mandrill_mailer/version'
6
6
 
7
7
  module MandrillMailer
@@ -1,15 +1,15 @@
1
1
  require "spec_helper"
2
2
 
3
- describe MandrillMailer::TransactionalMailer do
3
+ describe MandrillMailer::TemplateMailer do
4
4
  let(:image_path) { '/assets/image.jpg' }
5
5
  let(:default_host) { 'localhost:3000' }
6
6
  let(:mailer) {described_class.new}
7
7
  let(:api_key) { '1237861278' }
8
8
 
9
9
  before do
10
- MandrillMailer::TransactionalMailer.api_key = api_key
11
- MandrillMailer::TransactionalMailer.default_url_options = { host: default_host }
12
- MandrillMailer::TransactionalMailer.any_instance.stub(:image_path).and_return(image_path)
10
+ MandrillMailer.config.api_key = api_key
11
+ MandrillMailer.config.default_url_options = { host: default_host }
12
+ MandrillMailer.config.any_instance.stub(:image_path).and_return(image_path)
13
13
  end
14
14
 
15
15
  # this only works from within a Rails application
@@ -98,7 +98,7 @@ describe MandrillMailer::TransactionalMailer do
98
98
  subject { mailer.mandrill_mail(data) }
99
99
 
100
100
  before do
101
- MandrillMailer::TransactionalMailer.default from: from_email
101
+ MandrillMailer::TemplateMailer.default from: from_email
102
102
  end
103
103
 
104
104
  it 'should return the current class instance' do
@@ -106,7 +106,7 @@ describe MandrillMailer::TransactionalMailer do
106
106
  end
107
107
 
108
108
  it 'should produce the correct data' do
109
- mail = MandrillMailer::TransactionalMailer.new().mandrill_mail(data)
109
+ mail = MandrillMailer::TemplateMailer.new().mandrill_mail(data)
110
110
  mail.data.should eq ({"key" => api_key,
111
111
  "template_name" => data[:template],
112
112
  "template_content" => [{'name' => template_content_name, 'content' => template_content_content}],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandrill_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -89,7 +89,7 @@ files:
89
89
  - lib/mandrill_mailer.rb
90
90
  - lib/mandrill_mailer/mock.rb
91
91
  - lib/mandrill_mailer/railtie.rb
92
- - lib/mandrill_mailer/transactional_mailer.rb
92
+ - lib/mandrill_mailer/template_mailer.rb
93
93
  - lib/mandrill_mailer/version.rb
94
94
  - mandrill_mailer-0.0.2.gem
95
95
  - mandrill_mailer.gemspec