wco_models 3.1.0.88 → 3.1.0.90
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/wco/utils.scss +5 -1
- data/app/controllers/wco/application_controller.rb +6 -0
- data/app/controllers/wco/leadsets_controller.rb +1 -1
- data/app/mailers/wco_email/application_mailer.rb +11 -24
- data/app/models/wco/office_action.rb +9 -1
- data/app/models/wco_email/context.rb +26 -8
- data/app/views/wco/application/tinymce.html.erb +33 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7d502c6769f16c3fee34412c86b5646aa84c22c9c399da8c56cc2b496aa96b4
|
4
|
+
data.tar.gz: a4d4fef5edd8dea9656e2526b60b8c6b2a421e1955bc4c79dc1f04dfd4402d40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fbd26066c57cc0796a23dbb647b59816553fd87d6dbf87bc56bc0e6aa2d6039e017c6bd204519d4f4fff85c668a020e13558a52ec0e6d708941b9e369e5dd79
|
7
|
+
data.tar.gz: 951707c1098329b6df362e3050c02e5d0310021e9ebc7b1bc50d41096d1ab7f79bce5382db6610875953ce12846a17b9b3db0e25f03ad7e7375fd17e0d606240
|
@@ -37,7 +37,7 @@ class Wco::LeadsetsController < Wco::ApplicationController
|
|
37
37
|
authorize! :index, Leadset
|
38
38
|
@leadsets = Leadset.all.includes(:leads)
|
39
39
|
if params[:q].present?
|
40
|
-
@leadsets = @leadsets.where(
|
40
|
+
@leadsets = @leadsets.where({ company_url: /.*#{params[:q]}.*/i })
|
41
41
|
if @leadsets.length == 1
|
42
42
|
return redirect_to action: :show, id: @leadsets[0][:id]
|
43
43
|
end
|
@@ -6,6 +6,15 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
6
6
|
|
7
7
|
layout 'mailer'
|
8
8
|
|
9
|
+
def self.renderer ctx:
|
10
|
+
out = self.new
|
11
|
+
out.instance_variable_set( :@ctx, ctx )
|
12
|
+
out.instance_variable_set( :@lead, ctx.lead )
|
13
|
+
out.instance_variable_set( :@utm_tracking_str, ctx.utm_tracking_str )
|
14
|
+
out.instance_variable_set( :@unsubscribe_url, ctx.unsubscribe_url )
|
15
|
+
out.instance_variable_set( :@config, ctx.config )
|
16
|
+
return out
|
17
|
+
end
|
9
18
|
|
10
19
|
def forwarder_notify msg_id
|
11
20
|
@msg = WcoEmail::Message.find msg_id
|
@@ -46,32 +55,10 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
46
55
|
|
47
56
|
## 2023-04-02 _vp_ Continue.
|
48
57
|
## 2023-09-24 _vp_ Continue : )
|
58
|
+
## 2024-01-17 _vp_ Continue : )
|
49
59
|
def send_context_email ctx_id
|
50
60
|
@ctx = Ctx.find ctx_id
|
51
|
-
|
52
|
-
@tmpl_config = OpenStruct.new JSON.parse( @ctx.tmpl[:config_json] )
|
53
|
-
|
54
|
-
@utm_tracking_str = {
|
55
|
-
'cid' => @ctx.lead_id,
|
56
|
-
'utm_campaign' => @ctx.tmpl.slug,
|
57
|
-
'utm_medium' => 'email',
|
58
|
-
'utm_source' => @ctx.tmpl.slug,
|
59
|
-
}.map { |k, v| "#{k}=#{v}" }.join("&")
|
60
|
-
|
61
|
-
@unsubscribe_url = WcoEmail::Engine.routes.url_helpers.unsubscribes_url({
|
62
|
-
template_id: @ctx.tmpl.id,
|
63
|
-
lead_id: @lead.id,
|
64
|
-
token: @lead.unsubscribe_token,
|
65
|
-
host: Rails.application.routes.default_url_options[:host],
|
66
|
-
})
|
67
|
-
renderer = WcoEmail::ApplicationMailer.new
|
68
|
-
|
69
|
-
renderer.instance_variable_set( :@ctx, @ctx )
|
70
|
-
renderer.instance_variable_set( :@lead, @ctx.lead )
|
71
|
-
renderer.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
|
72
|
-
renderer.instance_variable_set( :@unsubscribe_url, @unsubscribe_url )
|
73
|
-
renderer.instance_variable_set( :@tmpl_config, @tmpl_config )
|
74
|
-
|
61
|
+
renderer = self.class.renderer ctx: @ctx
|
75
62
|
rendered_str = renderer.render_to_string("/wco_email/email_templates/_#{@ctx.tmpl.layout}")
|
76
63
|
@ctx.update({
|
77
64
|
rendered_str: rendered_str,
|
@@ -27,7 +27,15 @@ class Wco::OfficeAction
|
|
27
27
|
sch = self
|
28
28
|
sch.update!({ status: STATUS_INACTIVE })
|
29
29
|
|
30
|
-
|
30
|
+
begin
|
31
|
+
eval( sch.tmpl.action_exe )
|
32
|
+
rescue => err
|
33
|
+
puts! err, "Wco::OfficeAction#do_run"
|
34
|
+
::ExceptionNotifier.notify_exception(
|
35
|
+
err,
|
36
|
+
data: { office_action: self }
|
37
|
+
)
|
38
|
+
end
|
31
39
|
|
32
40
|
# schedule next actions & update the action
|
33
41
|
sch.tmpl.ties.each do |tie|
|
@@ -24,6 +24,7 @@ class WcoEmail::Context
|
|
24
24
|
end
|
25
25
|
|
26
26
|
field :body
|
27
|
+
## Looks good... 2024-01-17
|
27
28
|
def body
|
28
29
|
if self[:body].presence
|
29
30
|
return self[:body]
|
@@ -91,14 +92,9 @@ class WcoEmail::Context
|
|
91
92
|
attr_reader :tid
|
92
93
|
|
93
94
|
def get_binding
|
94
|
-
@lead
|
95
|
-
@utm_tracking_str =
|
96
|
-
|
97
|
-
'utm_campaign' => tmpl.slug,
|
98
|
-
'utm_medium' => 'email',
|
99
|
-
'utm_source' => tmpl.slug,
|
100
|
-
}.map { |k, v| "#{k}=#{v}" }.join("&")
|
101
|
-
eval( tmpl.config_exe )
|
95
|
+
@lead = lead
|
96
|
+
@utm_tracking_str = utm_tracking_str
|
97
|
+
# eval( tmpl.config_exe ) ## @TODO: remove? 2024-01-17
|
102
98
|
binding()
|
103
99
|
end
|
104
100
|
|
@@ -113,6 +109,28 @@ class WcoEmail::Context
|
|
113
109
|
outs.to_a
|
114
110
|
end
|
115
111
|
|
112
|
+
def config
|
113
|
+
OpenStruct.new JSON.parse( tmpl[:config_json] )
|
114
|
+
end
|
115
|
+
|
116
|
+
def utm_tracking_str
|
117
|
+
{
|
118
|
+
'cid' => lead_id,
|
119
|
+
'utm_campaign' => tmpl.slug,
|
120
|
+
'utm_medium' => 'email',
|
121
|
+
'utm_source' => tmpl.slug,
|
122
|
+
}.map { |k, v| "#{k}=#{v}" }.join("&")
|
123
|
+
end
|
124
|
+
|
125
|
+
def unsubscribe_url
|
126
|
+
WcoEmail::Engine.routes.url_helpers.unsubscribes_url({
|
127
|
+
host: Rails.application.routes.default_url_options[:host],
|
128
|
+
lead_id: lead_id,
|
129
|
+
template_id: tmpl.id,
|
130
|
+
token: lead.unsubscribe_token,
|
131
|
+
})
|
132
|
+
end
|
133
|
+
|
116
134
|
end
|
117
135
|
Ctx = WcoEmail::Context
|
118
136
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<!-- include libraries(jQuery, bootstrap) -->
|
5
|
+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
|
6
|
+
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
7
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
8
|
+
|
9
|
+
<!-- include codemirror (codemirror.css, codemirror.js, xml.js, formatting.js) -->
|
10
|
+
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
|
11
|
+
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.css">
|
12
|
+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
|
13
|
+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
|
14
|
+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>
|
15
|
+
|
16
|
+
<!-- include summernote css/js-->
|
17
|
+
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css">
|
18
|
+
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
|
22
|
+
<textarea class='tinymce'>
|
23
|
+
</textarea>
|
24
|
+
|
25
|
+
<script>
|
26
|
+
$('.tinymce').summernote({
|
27
|
+
height: 150, //set editable area's height
|
28
|
+
codemirror: { // codemirror options
|
29
|
+
theme: 'monokai'
|
30
|
+
}
|
31
|
+
});
|
32
|
+
</script>
|
33
|
+
</body></html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0.
|
4
|
+
version: 3.1.0.90
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -443,6 +443,7 @@ files:
|
|
443
443
|
- app/views/wco/application/_meta.haml
|
444
444
|
- app/views/wco/application/_metaline.haml
|
445
445
|
- app/views/wco/application/home.haml
|
446
|
+
- app/views/wco/application/tinymce.html.erb
|
446
447
|
- app/views/wco/galleries/_form.haml
|
447
448
|
- app/views/wco/galleries/_header.haml
|
448
449
|
- app/views/wco/galleries/_index.haml
|