wco_email 0.1.1.76 → 0.1.1.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/wco_email/api/contexts_controller.rb +27 -0
- data/app/controllers/wco_email/api_controller.rb +17 -1
- data/app/controllers/wco_email/email_filters_controller.rb +1 -1
- data/app/views/wco_email/api/contexts/summary.json.jbuilder +7 -0
- data/config/routes.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 598c923ca2af9d6d4b66479f643b5d0c261e5883bd1378e09bb9e8d207bf8d94
|
4
|
+
data.tar.gz: d80c9501a2636c8c9163ad8f7ef91aa991062d95083aa398dee5d23e5139cd3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52edcfe51e90ee55651fc2ab47641e6e2f80be5ee621ec08c391e1a94945cfc65186604782e422eeb79d522b8b454e854b29920c1e652ee618966009b35425ec
|
7
|
+
data.tar.gz: d2d817c9a1b8d9ca8655a9035b46e4f20d3a4ac0f70341333818edcacc637a05d440e6ee1582e832a5dcacc2053a556913997bf77e7a8e21c644ff9506c54963
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
class WcoEmail::Api::ContextsController < WcoEmail::ApiController
|
3
|
+
|
4
|
+
# before_action :set_lists
|
5
|
+
|
6
|
+
|
7
|
+
def summary
|
8
|
+
authorize! :summary, WcoEmail::Context
|
9
|
+
@results = WcoEmail::Context.summary
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
##
|
14
|
+
## Private
|
15
|
+
##
|
16
|
+
private
|
17
|
+
|
18
|
+
# def set_lists
|
19
|
+
# @email_layouts_list = WcoEmail::EmailTemplate::LAYOUTS
|
20
|
+
# @email_templates_list = [ [nil, nil] ] + WcoEmail::EmailTemplate.all.map { |tmpl| [ tmpl.slug, tmpl.id ] }
|
21
|
+
# @leads_list = Wco::Lead.list
|
22
|
+
# end
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
end
|
27
|
+
|
@@ -1,8 +1,10 @@
|
|
1
1
|
|
2
2
|
class WcoEmail::ApiController < ActionController::Base
|
3
3
|
|
4
|
-
before_action :check_credentials
|
4
|
+
before_action :check_credentials, only: [ :create_email_message ]
|
5
|
+
before_action :decode_jwt, except: [ :create_email_message ]
|
5
6
|
skip_before_action :verify_authenticity_token
|
7
|
+
layout false
|
6
8
|
|
7
9
|
def create_email_message
|
8
10
|
# puts! params, 'params'
|
@@ -28,4 +30,18 @@ class WcoEmail::ApiController < ActionController::Base
|
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
33
|
+
def decode_jwt
|
34
|
+
if Rails.env.test?
|
35
|
+
sign_in User.find_by({ email: 'victor@wasya.co' })
|
36
|
+
return
|
37
|
+
end
|
38
|
+
|
39
|
+
out = JWT.decode params[:jwt_token], nil, false
|
40
|
+
email = out[0]['email']
|
41
|
+
user = User.find_by({ email: email })
|
42
|
+
puts! user, 'user'
|
43
|
+
|
44
|
+
sign_in user
|
45
|
+
end
|
46
|
+
|
31
47
|
end
|
data/config/routes.rb
CHANGED
@@ -6,6 +6,8 @@ WcoEmail::Engine.routes.draw do
|
|
6
6
|
get 'analytics', to: 'application#analytics'
|
7
7
|
get 'tinymce', to: 'application#tinymce', as: :application_tinymce
|
8
8
|
|
9
|
+
get 'api/contexts/summary', to: '/wco_email/api/contexts#summary'
|
10
|
+
|
9
11
|
get 'conversations/in/:tagname', to: '/wco_email/conversations#index', as: :conversations_in
|
10
12
|
get 'conversations/not-in/:tagname_not', to: '/wco_email/conversations#index', as: :conversations_not_in
|
11
13
|
get 'conversations/:id', to: '/wco_email/conversations#show', as: :conversation
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.78
|
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-08-
|
11
|
+
date: 2024-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -309,6 +309,7 @@ files:
|
|
309
309
|
- app/assets/stylesheets/wco_email/logs.scss
|
310
310
|
- app/assets/stylesheets/wco_email/messages.scss
|
311
311
|
- app/assets/stylesheets/wco_email/tags.scss
|
312
|
+
- app/controllers/wco_email/api/contexts_controller.rb
|
312
313
|
- app/controllers/wco_email/api_controller.rb
|
313
314
|
- app/controllers/wco_email/application_controller.rb
|
314
315
|
- app/controllers/wco_email/contexts_controller.rb
|
@@ -366,6 +367,7 @@ files:
|
|
366
367
|
- app/views/wco_email/_analytics.erb
|
367
368
|
- app/views/wco_email/_main_header.haml
|
368
369
|
- app/views/wco_email/_sidebar.haml
|
370
|
+
- app/views/wco_email/api/contexts/summary.json.jbuilder
|
369
371
|
- app/views/wco_email/contexts/_form.haml
|
370
372
|
- app/views/wco_email/contexts/_form_reply.haml
|
371
373
|
- app/views/wco_email/contexts/_header.haml
|