talktome 2.1.1 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/talktome/client/local.rb +5 -1
- data/lib/talktome/version.rb +2 -2
- data/spec/client/test_local.rb +6 -3
- data/spec/fixtures/layouts/email.html +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 857218afa869c225716d52dc6b11a282acc64bc1ef054ef8eee6d14d229eced6
|
4
|
+
data.tar.gz: e2a1c47c60ef0a1d713c8a7c235329828f8f5e63b34fdc13b39522d7d86f15da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee3a42162623c6cfeeb0149c107149674eadbba101d8d538358555bede65e62e9c90c1ef2094b3bfb7079a4ab734f1c4d0d7ba4a276147174ab9ef87513843d
|
7
|
+
data.tar.gz: 8ad2d552e89510ff13265027e9ca8cc6ab50cd42ef83ba8266978514bb5ca4c5ade79523ce3216548505d2bb7f7c6ff44ebd105d2693e6b05ff340e4db806c91
|
@@ -34,9 +34,13 @@ module Talktome
|
|
34
34
|
|
35
35
|
def templater(strategy)
|
36
36
|
return nil unless tpl_folder = options[:layouts] || options[:templates]
|
37
|
+
|
37
38
|
->(message, src, ctype) {
|
38
39
|
if (file = tpl_folder/"#{strategy}.#{ctype}").file?
|
39
|
-
data =
|
40
|
+
data = message.data.merge({
|
41
|
+
metadata: message.metadata,
|
42
|
+
yield: src
|
43
|
+
})
|
40
44
|
Mustache.render(file.read, data)
|
41
45
|
else
|
42
46
|
src
|
data/lib/talktome/version.rb
CHANGED
data/spec/client/test_local.rb
CHANGED
@@ -22,7 +22,10 @@ module Talktome
|
|
22
22
|
}
|
23
23
|
|
24
24
|
let(:tpldata) {
|
25
|
-
{
|
25
|
+
{
|
26
|
+
who: "Test user",
|
27
|
+
lang: "en",
|
28
|
+
}
|
26
29
|
}
|
27
30
|
|
28
31
|
before(:each) {
|
@@ -51,7 +54,7 @@ module Talktome
|
|
51
54
|
it 'sends email when requested' do
|
52
55
|
client.talktome("welcome", user, tpldata, [:email])
|
53
56
|
expect(strategy.last.message).not_to be_nil
|
54
|
-
expect(strategy.last.message.to_html).to eql("<html><title>Hello Test user</title><body><h1>Hello Test user</h1>\n\n<p>Welcome to this email example!</p>\n\n<h3>Test user</h3>\n</body></html>\n")
|
57
|
+
expect(strategy.last.message.to_html).to eql("<html lang='en'><title>Hello Test user</title><body><h1>Hello Test user</h1>\n\n<p>Welcome to this email example!</p>\n\n<h3>Test user</h3>\n</body></html>\n")
|
55
58
|
end
|
56
59
|
|
57
60
|
it 'yields the callback with the email' do
|
@@ -72,7 +75,7 @@ module Talktome
|
|
72
75
|
|
73
76
|
it 'sends email when requested' do
|
74
77
|
client.talktome("welcome", user, tpldata, [:email])
|
75
|
-
expect(strategy.last.message.to_html).to eql("<html><title>Hello Test user</title><body><h1>Hello Test user</h1>\n\n<p>Welcome to this email example!</p>\n\n<h3>Test user</h3>\n</body></html>\n")
|
78
|
+
expect(strategy.last.message.to_html).to eql("<html lang='en'><title>Hello Test user</title><body><h1>Hello Test user</h1>\n\n<p>Welcome to this email example!</p>\n\n<h3>Test user</h3>\n</body></html>\n")
|
76
79
|
end
|
77
80
|
|
78
81
|
end
|
@@ -1 +1 @@
|
|
1
|
-
<html><title>{{metadata.subject}}</title><body>{{{yield}}}</body></html>
|
1
|
+
<html lang='{{lang}}'><title>{{metadata.subject}}</title><body>{{{yield}}}</body></html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: talktome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -140,20 +140,20 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: 0.
|
143
|
+
version: 0.12.0
|
144
144
|
- - "<"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 0.
|
146
|
+
version: 0.13.0
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 0.
|
153
|
+
version: 0.12.0
|
154
154
|
- - "<"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: 0.
|
156
|
+
version: 0.13.0
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: rack-robustness
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
@@ -223,7 +223,7 @@ homepage: http://github.com/enspirit/talktome
|
|
223
223
|
licenses:
|
224
224
|
- MIT
|
225
225
|
metadata: {}
|
226
|
-
post_install_message:
|
226
|
+
post_install_message:
|
227
227
|
rdoc_options: []
|
228
228
|
require_paths:
|
229
229
|
- lib
|
@@ -238,8 +238,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
238
|
- !ruby/object:Gem::Version
|
239
239
|
version: '0'
|
240
240
|
requirements: []
|
241
|
-
rubygems_version: 3.
|
242
|
-
signing_key:
|
241
|
+
rubygems_version: 3.4.10
|
242
|
+
signing_key:
|
243
243
|
specification_version: 4
|
244
244
|
summary: Talktome helps you talk to users by email, messaging, sms, etc.
|
245
245
|
test_files: []
|