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 +4 -4
- data/README.md +10 -0
- data/lib/apostle/mail.rb +8 -0
- data/lib/apostle/version.rb +1 -1
- data/spec/mail_spec.rb +6 -0
- 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: 15c9c0b560f871d4f52650278822a064cf2dbef0
|
4
|
+
data.tar.gz: d1f7aa54b850d12d37117b51c4da9320256ccd19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/apostle/mail.rb
CHANGED
@@ -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)
|
data/lib/apostle/version.rb
CHANGED
data/spec/mail_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|