mandrill_mailer 1.2.0 → 1.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1044b6baf3d9a8f33f1cc09f86516c21d5228c4
4
- data.tar.gz: ae3a798dacfe9294991ee3beb3755665558c26ea
3
+ metadata.gz: 075ffba690530bca8df7f53407ca3f3ea4e3f9ca
4
+ data.tar.gz: bda4e177b0b3325949c0ae481105ac6b81cdbe39
5
5
  SHA512:
6
- metadata.gz: 532a82b1c66cb927f5e36734c9fe7ec39ac040d4e976c15f3b76829745f36dee8255d48636b71b75c12b0d7497703a04a2cb74db4c29efb2f10e76221b88d24d
7
- data.tar.gz: bb9e61792cffe0179339659bfdde72f87237bafe5097a4193646ffc018a309017b331ba39196b3d7938dae52bdb872d47b75e1212d0bf8f4b140619b00dbe361
6
+ metadata.gz: 2b97eddbad1f851372304c837fe31eda9fde2212e6ceca9b0350569739ea3855d435a8e7f2215eed816fe8b95b6689efd8a83f369d36f1290e3a550d86a8fc23
7
+ data.tar.gz: 4892c39bb9d2756d391d375b3b006a6c0299d4cbf122ae5112395e9b6d8f5e533141cef4a0e7ebaaa705b08909714851788ace653c4e706fdc2c95dcae00acb4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## 1.3.0 - 2016-3-02
6
+ ### Added
7
+ - Fixed an issue where deliver_later functionality was not working as intended when inheriting from the mailer classes. via @eric1234
8
+
5
9
  ## 1.2.0 - 2015-12-22
6
10
  ### Added
7
11
  - Support for for deliver_later and deliver_now using ActiveJob. via @BenRuns
data/README.md CHANGED
@@ -39,7 +39,7 @@ ActionMailer::Base.delivery_method = :smtp
39
39
 
40
40
  MandrillMailer.configure do |config|
41
41
  config.api_key = ENV['MANDRILL_API_KEY']
42
- config.config.deliver_later_queue_name = :default
42
+ config.deliver_later_queue_name = :default
43
43
  end
44
44
  ```
45
45
 
@@ -108,11 +108,12 @@ end
108
108
 
109
109
  * `:subject` - Subject of the email. If no subject supplied, it will fall back to the template default subject from within Mandrill
110
110
 
111
- * `:to`(required) - Accepts an email String, a Hash with :name and :email keys, or an Array of Hashes with :name and :email keys
111
+ * `:to`(required) - Accepts an email String, a Hash with :name and :email keys, or an Array of Hashes with :name, :email, and :type keys
112
112
  - examples:
113
113
  1. `'example@domain.com'`
114
114
  2. `{ email: 'someone@email.com', name: 'Bob Bertly' }`
115
115
  3. `[{ email: 'someone@email.com', name: 'Bob Bertly' }, { email: 'other@email.com', name: 'Claire Nayo' }]`
116
+ 4. `[{ email: 'someone@email.com', name: 'Bob Bertly', type: 'to'}, { email: 'secret_recipient1@email.com', name: 'Secret Recipient One', type: 'bcc'}, { email: 'secret_recipient2@email.com', name: 'Secret Recipient Two', type: 'bcc'}]`
116
117
 
117
118
  * `:vars` - A Hash of merge tags made available to the email. Use them in the
118
119
  email by wrapping them in `*||*`. For example `{'OWNER_NAME' => 'Suzy'}` is used by doing: `*|OWNER_NAME|*` in the email template within Mandrill
@@ -2,12 +2,12 @@ require 'mandrill_mailer/message_mailer'
2
2
  module MandrillMailer
3
3
  class MandrillMessageJob < ActiveJob::Base
4
4
  queue_as { MandrillMailer.config.deliver_later_queue_name }
5
-
6
- def perform(message, async, ip_pool, send_at)
7
- mailer = MandrillMailer::MessageMailer.new
5
+
6
+ def perform(message, async, ip_pool, send_at, mailer='MandrillMailer::MessageMailer')
7
+ mailer = mailer.constantize.new
8
8
  mailer.message = message
9
9
  mailer.async = async
10
- mailer.ip_pool = ip_pool
10
+ mailer.ip_pool = ip_pool
11
11
  mailer.send_at = send_at
12
12
  mailer.deliver_now
13
13
  end
@@ -3,13 +3,13 @@ module MandrillMailer
3
3
  class MandrillTemplateJob < ActiveJob::Base
4
4
  queue_as { MandrillMailer.config.deliver_later_queue_name }
5
5
 
6
- def perform(template_name, template_content, message, async, ip_pool, send_at)
7
- mailer = MandrillMailer::TemplateMailer.new
6
+ def perform(template_name, template_content, message, async, ip_pool, send_at, mailer='MandrillMailer::TemplateMailer')
7
+ mailer = mailer.constantize.new
8
8
  mailer.template_name = template_name
9
9
  mailer.template_content = template_content
10
10
  mailer.message = message
11
11
  mailer.async = async
12
- mailer.ip_pool = ip_pool
12
+ mailer.ip_pool = ip_pool
13
13
  mailer.send_at = send_at
14
14
  mailer.deliver_now
15
15
  end
@@ -105,7 +105,7 @@ module MandrillMailer
105
105
  end
106
106
 
107
107
  def deliver_later(options={})
108
- MandrillMailer::MandrillMessageJob.set(options).perform_later(message, async, ip_pool, send_at)
108
+ MandrillMailer::MandrillMessageJob.set(options).perform_later(message, async, ip_pool, send_at, self.class.name)
109
109
  end
110
110
  end
111
111
  end
@@ -127,7 +127,7 @@ module MandrillMailer
127
127
  end
128
128
 
129
129
  def deliver_later(options={})
130
- MandrillMailer::MandrillTemplateJob.set(options).perform_later(template_name, template_content, message, async, ip_pool, send_at)
130
+ MandrillMailer::MandrillTemplateJob.set(options).perform_later(template_name, template_content, message, async, ip_pool, send_at, self.class.name)
131
131
  end
132
132
 
133
133
  # Handle template mailer specifics before formating the given args
@@ -1,3 +1,3 @@
1
1
  module MandrillMailer
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandrill_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Rensel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-22 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport