mandrill_mailer 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -2
- data/lib/mandrill_mailer/mandrill_message_later.rb +4 -4
- data/lib/mandrill_mailer/mandrill_template_later.rb +3 -3
- data/lib/mandrill_mailer/message_mailer.rb +1 -1
- data/lib/mandrill_mailer/template_mailer.rb +1 -1
- data/lib/mandrill_mailer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 075ffba690530bca8df7f53407ca3f3ea4e3f9ca
|
4
|
+
data.tar.gz: bda4e177b0b3325949c0ae481105ac6b81cdbe39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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 :
|
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 =
|
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 =
|
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
|
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.
|
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:
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|