cells-mailer 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/bin/console +4 -4
- data/lib/cell/mailer/version.rb +1 -1
- data/lib/cell/mailer.rb +15 -4
- 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: 1fa72606b6e77402bfd9832e65298688b4dfd34b
|
4
|
+
data.tar.gz: 57edcc147640ec4e0912f7ac4b59ec9434d20bf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3fd1ef9e49f420b4a0d443a0376cebc7fa86cb7c63fb011f14ed03e628000e7b8204e2195b0d9725f44790b97a4a38924deb6f8cbfccbb113da51b28900ccd8
|
7
|
+
data.tar.gz: bbc350a8bb1c75e0787585844bf0eb71b302881bdd684cf32a518f42ae74d477a7135ec2b72aa426e4b5e925aa9d8238418c36d8341705513a71de233bda8de8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.4.1 [☰](https://github.com/timoschilling/cells-mailer/compare/v0.4.0...v0.4.1)
|
4
|
+
|
5
|
+
* fix a bug with `delivery_method` handling
|
6
|
+
|
3
7
|
## v0.4.0 [☰](https://github.com/timoschilling/cells-mailer/compare/v0.3.0...v0.4.0)
|
4
8
|
|
5
9
|
* global configuration
|
data/Gemfile
CHANGED
data/bin/console
CHANGED
@@ -7,8 +7,8 @@ require "cells-mailer"
|
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
|
11
|
-
|
10
|
+
require "pry"
|
11
|
+
Pry.start
|
12
12
|
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
13
|
+
# require "irb"
|
14
|
+
# IRB.start
|
data/lib/cell/mailer/version.rb
CHANGED
data/lib/cell/mailer.rb
CHANGED
@@ -22,12 +22,23 @@ module Cell
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def deliver(options = {})
|
25
|
-
|
26
|
-
mail.deliver
|
25
|
+
build_mail(options).deliver
|
27
26
|
end
|
28
27
|
|
29
28
|
private
|
30
29
|
|
30
|
+
def build_mail(options)
|
31
|
+
options, delivery_method = process_mail_options(options)
|
32
|
+
|
33
|
+
mail = Mail.new options
|
34
|
+
mail.delivery_method *delivery_method
|
35
|
+
mail
|
36
|
+
end
|
37
|
+
|
38
|
+
def mail_delivery_method
|
39
|
+
self.class.mailer.mail_options[:delivery_method]
|
40
|
+
end
|
41
|
+
|
31
42
|
def process_mail_options(options)
|
32
43
|
if options[:body] && options[:method]
|
33
44
|
raise ArgumentError, "You can't pass in `:method` and `:body` at once!"
|
@@ -41,14 +52,14 @@ module Cell
|
|
41
52
|
options[field] ||= self.class.mailer.send(field)
|
42
53
|
end
|
43
54
|
|
44
|
-
|
55
|
+
self.class.mailer.mail_options.each do |key, value|
|
45
56
|
options[key] = value
|
46
57
|
end
|
47
58
|
|
48
59
|
state = options.delete(:method) || :show
|
49
60
|
options[:body] ||= call(state)
|
50
61
|
|
51
|
-
options
|
62
|
+
[options, options.delete(:delivery_method)]
|
52
63
|
end
|
53
64
|
|
54
65
|
module ClassMethods
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cells-mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Schilling
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cells
|