trikle-mail 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/trikle-mail +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8089c46497798716ccc16bb4826b67b3eb2b8c0e
|
4
|
+
data.tar.gz: de12d40c097ba2a1a49c21109a9fa953920c23aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c935accf7de45a5117aa5c6690e49a8e43e0b3d6f7ce91b9933e6c08dbaafcc8ccb6db4c9f0a85d2ab59699ed78c33cc3e5ede166699e561c022a90c0a6e3c16
|
7
|
+
data.tar.gz: 3211f773a1ad8f0ab713e5f1818b5a36956ff1ae2f76cb3a592f16b35c2cc3366f5d8cb7efafdd7739718b1a632fc92a4bae23374461fd920bf1a6da6bb1e441
|
data/bin/trikle-mail
CHANGED
@@ -42,7 +42,8 @@ class TrikleMail
|
|
42
42
|
data_hashes.length.to_f
|
43
43
|
|
44
44
|
data_hashes.each do |hash|
|
45
|
-
|
45
|
+
template = File.read(hash.fetch(:template, options.template)).
|
46
|
+
gsub(/%(?!{)/, '') % hash
|
46
47
|
mail = Mail.new do
|
47
48
|
from hash.fetch(:from, options.from)
|
48
49
|
to hash.fetch(:to, hash.fetch(:email) { raise 'no email address found in to column!' })
|
@@ -51,11 +52,11 @@ class TrikleMail
|
|
51
52
|
if options.html
|
52
53
|
html_part do
|
53
54
|
content_type 'text/html; charset=UTF-8'
|
54
|
-
body
|
55
|
+
body template
|
55
56
|
end
|
56
57
|
else
|
57
58
|
text_part do
|
58
|
-
body
|
59
|
+
body template
|
59
60
|
end
|
60
61
|
end
|
61
62
|
end
|