apostle 0.2.2 → 0.2.3

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: f04a798c127f6a9b9d9e9438866c0ef2866aecbb
4
- data.tar.gz: add05e02d502f9138f9d8c7303b090148a24d8ec
3
+ metadata.gz: 15c9c0b560f871d4f52650278822a064cf2dbef0
4
+ data.tar.gz: d1f7aa54b850d12d37117b51c4da9320256ccd19
5
5
  SHA512:
6
- metadata.gz: 1c19b1b54b12fad8e688c02ce16ae84b398a42b555582670fb0a0afc73205718ef372991a94509cdcfa66abb64d0ac376eb622e96369eb0aed742f531888240c
7
- data.tar.gz: cdc62c99f958008f26a5616326a7425c07abbe03a54d08402c8d01d293e318b7cb4cc0e2de11c523116ad864b08583a7255bc52d9dbb287919ec5311f881b6ea
6
+ metadata.gz: 483ee4a7541f5d056ae5f2f29c8b4f58c08800809d62842b8229fc1cd93ac22d678e1fa343aad98211f7353e9ab2a2e26a8336a554a60c6e44784a1092d2595a
7
+ data.tar.gz: 512a50c4d8c9d7c97ba48d42b2b22394eb67c540074528bd3c76b79a614b8e78a20b2015a82172cd2ce01396d3806c591b334cb5fda5b557578e47b4ee90f5c1
data/README.md CHANGED
@@ -89,6 +89,16 @@ mail.header 'X-Some-Header'
89
89
  => "my custom header"
90
90
  ```
91
91
 
92
+ ### Attachments
93
+
94
+ You can send attachments by adding to attachments hash on the mail object.
95
+
96
+ ```ruby
97
+ mail.attachments["invoice.pdf"] = File.read("invoices/12345.pdf")
98
+ ```
99
+
100
+
101
+
92
102
  ## Sending Multiple Emails
93
103
 
94
104
  To speed up processing, you can send more than one email at a time.
@@ -34,6 +34,14 @@ module Apostle
34
34
  end
35
35
  end
36
36
 
37
+ def cc=(address)
38
+ header("cc", address)
39
+ end
40
+
41
+ def bcc=(address)
42
+ header("bcc", address)
43
+ end
44
+
37
45
  # Allow convenience setters for the data payload
38
46
  # E.G. mail.potato= "Something" will set @data['potato']
39
47
  def method_missing(method, *args)
@@ -1,3 +1,3 @@
1
1
  module Apostle
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -56,6 +56,8 @@ describe Apostle::Mail do
56
56
  mail.email = 123
57
57
  mail.reply_to = "someone"
58
58
  mail.name = "name"
59
+ mail.cc = "user+cc@apostle.io"
60
+ mail.bcc = ["user+bcc1@apostle.io", "user+bcc2@apostle.io"]
59
61
  mail.data = { "Hello" => "World" }
60
62
  mail.foo = 'Bar'
61
63
  mail.to_h.must_equal({"123" => {
@@ -63,6 +65,10 @@ describe Apostle::Mail do
63
65
  "from" => "f",
64
66
  "reply_to" => "someone",
65
67
  "name" => "name",
68
+ "headers" => {
69
+ "cc"=>"user+cc@apostle.io",
70
+ "bcc"=>["user+bcc1@apostle.io", "user+bcc2@apostle.io"]
71
+ },
66
72
  "data" => { "Hello" => "World", "foo" => "Bar"}
67
73
  }})
68
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apostle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mal Curtis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest