apostle-rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apostle_rails/mailer.rb +4 -12
- data/lib/apostle_rails/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: e40feb7201325989310cb29d4ae0686695f2dfd6
|
4
|
+
data.tar.gz: bdd50f8383d0cc19773eaaac7b6e57835fd32da4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c4617edd9f93720619ca0adbd3f5c1eb78d20d5d0059042d84e58c116052332bf0778e6d89f4e5d2c53a9613ae0fe2563154fd1dd9eaa184eee9be21cf63b01
|
7
|
+
data.tar.gz: c094aa154c827351edaa7111ab5dad6cc16941edd90babc8f139c456325f133a33db71836802fcefc19153be273eb32651ec56602ba92129fc68c966c5831fb2
|
data/lib/apostle_rails/mailer.rb
CHANGED
@@ -18,7 +18,7 @@ module Apostle
|
|
18
18
|
self.send(method_name, *args)
|
19
19
|
end
|
20
20
|
|
21
|
-
def mail(template,
|
21
|
+
def mail(template, variables = {}, &block)
|
22
22
|
m = @_message
|
23
23
|
m.template_id = template
|
24
24
|
|
@@ -29,22 +29,14 @@ module Apostle
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# Handle defaults
|
32
|
-
|
32
|
+
variables = variables.reverse_merge(default_values)
|
33
33
|
|
34
34
|
# Set configure delivery behavior
|
35
35
|
# TODO Enable config options such as perform_deliveries and raise_delivery_errors
|
36
36
|
# wrap_delivery_behavior!(headers.delete(:delivery_method),headers.delete(:delivery_method_options))
|
37
37
|
|
38
|
-
#
|
39
|
-
|
40
|
-
|
41
|
-
# Anything that's not an assignable attribute is a header
|
42
|
-
assignable_headers = headers.except(*directly_assignable)
|
43
|
-
assignable_headers.each { |k, v| m.header(k, v) }
|
44
|
-
|
45
|
-
# Assign the assignable attributes
|
46
|
-
assignable_attributes = headers.slice(*directly_assignable)
|
47
|
-
assignable_attributes.each { |k, v| m.send("#{k}=", v) }
|
38
|
+
# Assign all attributes
|
39
|
+
variables.each { |k, v| m.send("#{k}=", v) }
|
48
40
|
|
49
41
|
# Assign all new instance vars as attributes
|
50
42
|
all_instance_vars = self.instance_variables.dup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apostle-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mal Curtis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|