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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/trikle-mail +4 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1d4893cd70f9c06b996c6fb6e836d286b49d9f1
4
- data.tar.gz: 743d5bf00407d3a037ba23d1e5de77fb5b3a824a
3
+ metadata.gz: 8089c46497798716ccc16bb4826b67b3eb2b8c0e
4
+ data.tar.gz: de12d40c097ba2a1a49c21109a9fa953920c23aa
5
5
  SHA512:
6
- metadata.gz: e9e0bd7203ce7a7af339f53129d0f6441c2cb202d0c118309448499eabdac39bbd7869f558d318f7e3ed11d10bb2f63a5bbc758ea8e97c5685d9299ac8c754ce
7
- data.tar.gz: f07592534deba8b7ac50d29e44fbbc2f9caffa897e4415f3c0c1390d7a3721a698a32b1e304c518ef93087a0085621252e42c84e39f0dfe5a2f9733cf33bd1c6
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 File.read(hash.fetch(:template, options.template)) % hash
55
+ body template
55
56
  end
56
57
  else
57
58
  text_part do
58
- body File.read(hash.fetch(:template, options.template)) % hash
59
+ body template
59
60
  end
60
61
  end
61
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trikle-mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jasper Lyons