simple_invoice-emailer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -16,11 +16,13 @@ module SimpleInvoice
|
|
16
16
|
|
17
17
|
def mail_instance invoice
|
18
18
|
_email_from = get_config(:email_from)
|
19
|
+
_email_bcc = get_optional_config(:email_bcc)
|
19
20
|
_email_subject = email_subject(invoice)
|
20
21
|
_email_body = email_body(invoice)
|
21
22
|
Mail.new do
|
22
23
|
to invoice.contact.email
|
23
24
|
from _email_from
|
25
|
+
bcc _email_bcc if _email_bcc
|
24
26
|
subject _email_subject
|
25
27
|
body _email_body
|
26
28
|
end
|
@@ -35,11 +37,15 @@ module SimpleInvoice
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def get_config key
|
38
|
-
|
40
|
+
get_optional_config(key).tap do |value|
|
39
41
|
raise "Missing config key #{key}" if value.nil?
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
45
|
+
def get_optional_config key
|
46
|
+
@mail_config[key]
|
47
|
+
end
|
48
|
+
|
43
49
|
end
|
44
50
|
end
|
45
51
|
end
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "simple_invoice-emailer"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.2"
|
7
7
|
s.authors = ["Joel Plane"]
|
8
8
|
s.email = ["joel.plane@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/joelplane/simple_invoice-emailer"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_invoice-emailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: text-table
|