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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 820ba8052c67159b8831ba1bbbf574194dd6294d
4
- data.tar.gz: f03e43cbbda3b74b1990868e173a6d7ca9587131
3
+ metadata.gz: e40feb7201325989310cb29d4ae0686695f2dfd6
4
+ data.tar.gz: bdd50f8383d0cc19773eaaac7b6e57835fd32da4
5
5
  SHA512:
6
- metadata.gz: 75f1e252eb9f2834b916a0ea7f565bd4e3e657859db02ce40bf8bb53d17f2a194de3db301c59a58f0f5b39b391b62ec95b68cb2cf0dea1879da376beebd056b7
7
- data.tar.gz: bee4a097b19fa528b0feb63426f0634a77cf8368407fea42465b6324718c3917692f69542d733382854db0aab8548abe0e2b4efe3bbaf5a1e51130bb595ddee7
6
+ metadata.gz: 7c4617edd9f93720619ca0adbd3f5c1eb78d20d5d0059042d84e58c116052332bf0778e6d89f4e5d2c53a9613ae0fe2563154fd1dd9eaa184eee9be21cf63b01
7
+ data.tar.gz: c094aa154c827351edaa7111ab5dad6cc16941edd90babc8f139c456325f133a33db71836802fcefc19153be273eb32651ec56602ba92129fc68c966c5831fb2
@@ -18,7 +18,7 @@ module Apostle
18
18
  self.send(method_name, *args)
19
19
  end
20
20
 
21
- def mail(template, headers, &block)
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
- headers = headers.reverse_merge(default_values)
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
- # List of assignable attributes
39
- directly_assignable = [:to, :from, :email, :name, :layout_id, :template, :reply_to]
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
@@ -1,3 +1,3 @@
1
1
  module ApostleRails
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-12 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler