wco_email 0.1.1.89 → 0.1.1.90
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.txt +32 -31
- data/app/controllers/wco_email/api/email_action_templates_controller.rb +11 -0
- data/app/controllers/wco_email/api/email_filters_controller.rb +70 -0
- data/app/controllers/wco_email/api/email_templates_controller.rb +11 -0
- data/app/views/wco_email/api/email_action_templates/index.json.jbuilder +7 -0
- data/app/views/wco_email/api/email_filter_actions/_index.json.jbuilder +9 -0
- data/app/views/wco_email/api/email_filter_conditions/_index.json.jbuilder +12 -0
- data/app/views/wco_email/api/email_filters/index.json.jbuilder +10 -0
- data/app/views/wco_email/api/email_filters/show.json.jbuilder +6 -0
- data/app/views/wco_email/api/email_templates/index.json.jbuilder +7 -0
- data/app/views/wco_email/email_filters/_form2.haml +1 -1
- data/app/views/wco_email/email_filters/_header.haml +1 -0
- data/app/views/wco_email/email_filters/index.haml +1 -1
- data/app/views/wco_email/email_filters/show.haml +16 -0
- data/config/routes.rb +10 -3
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cf2d25166419cff60c9bcbeebe527591112cf054dab2b841a43675fa404129b
|
4
|
+
data.tar.gz: 12bb222f2cba5a5c8413f08ca1fe52c34a21c6b428bd0a74d1a34b0532ac54ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a7da610eff9aba23efdeedd13848da949531876345e06cd5b80badfbc5655ae06e23fa5e8a2b8a270bec7dabf02bb6fe30a6d4ec4f297628cf59db193dc8580
|
7
|
+
data.tar.gz: 2529ddf7f9f88e5b03f6cb178a4c8da3b461b29ef6937b8d962cbb9a300df8f98f5f39bfe09cee620c6bfaf964face5d5457bb380de10cc27a59d47fee0ca411
|
data/README.txt
CHANGED
@@ -1,54 +1,55 @@
|
|
1
1
|
|
2
2
|
= Install =
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
alias be='bundle exec '
|
5
|
+
alias dc='docker-compose '
|
6
6
|
|
7
|
-
|
7
|
+
Copy and edit the config file:
|
8
8
|
|
9
|
-
|
9
|
+
cp _env .env
|
10
10
|
|
11
|
-
|
11
|
+
Check out the repository and run:
|
12
12
|
|
13
|
-
|
13
|
+
bundle
|
14
14
|
|
15
|
-
|
15
|
+
Ask Victor to add your user (email) to the remote auth server. Or use test-1@wasya.co
|
16
16
|
|
17
|
-
|
17
|
+
Note: the mongodb port is 27041.
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
dc up -d mongo_development
|
20
|
+
dc up -d localstack_development
|
21
21
|
|
22
|
-
|
22
|
+
In the rails console ( cd test/dummy ; be rails c ):
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
profile = Wco::Profile.create email: 'test-1@wasya.co'
|
25
|
+
inbox = Wco::Tag.create slug: 'inbox'
|
26
26
|
|
27
|
-
|
27
|
+
You need a copy of wco_models.git locally ( default location is ~/projects/ruby/wco_models )
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
awslocal s3api create-bucket --bucket wco-email-development
|
30
|
+
awslocal s3api create-bucket --bucket wco-email-ses-development
|
31
31
|
|
32
|
-
|
32
|
+
== Troubleshooting ==
|
33
33
|
|
34
|
-
|
34
|
+
Issue:
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
checking for yaml.h... no
|
37
|
+
yaml.h not found
|
38
38
|
|
39
|
-
|
39
|
+
Solution:
|
40
40
|
|
41
|
-
|
41
|
+
brew install libyaml
|
42
42
|
|
43
43
|
= Use =
|
44
|
-
Please see below for example usage commands.
|
45
44
|
|
46
|
-
|
47
|
-
be sidekiq -q wco_email_rb_mailers -q wco_email_rb_default -q wco_email_rb
|
45
|
+
Please see below for example usage commands.
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
cd test/dummy
|
48
|
+
be sidekiq -q wco_email_rb_mailers -q wco_email_rb_default -q wco_email_rb
|
49
|
+
|
50
|
+
docker run \
|
51
|
+
--rm -it \
|
52
|
+
-p 127.0.0.1:4566:4566 \
|
53
|
+
-p 127.0.0.1:4510-4559:4510-4559 \
|
54
|
+
-v /var/run/docker.sock:/var/run/docker.sock \
|
55
|
+
localstack/localstack
|
@@ -0,0 +1,70 @@
|
|
1
|
+
|
2
|
+
class WcoEmail::Api::EmailFiltersController < WcoEmail::ApiController
|
3
|
+
|
4
|
+
def create
|
5
|
+
authorize! :create, WcoEmail::EmailFilter
|
6
|
+
@item = ::WcoEmail::EmailFilter.new email_filter_pparams
|
7
|
+
|
8
|
+
if @item.save
|
9
|
+
render json: { id: @item.id.to_s }, status: :ok
|
10
|
+
else
|
11
|
+
render json: { messages: @item.errors.full_messages }, status: 400
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def destroy
|
16
|
+
@item = ::WcoEmail::EmailFilter.find params[:id]
|
17
|
+
authorize! :destroy, @item
|
18
|
+
if @item.delete
|
19
|
+
render json: { }, status: :ok
|
20
|
+
else
|
21
|
+
render json: { messages: @item.errors.full_messages }, status: 400
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def index
|
26
|
+
authorize! :index, WcoEmail::EmailFilter
|
27
|
+
@items = ::WcoEmail::EmailFilter.all
|
28
|
+
# respond_to do |format|
|
29
|
+
# format.json do
|
30
|
+
# render
|
31
|
+
# end
|
32
|
+
# end
|
33
|
+
end
|
34
|
+
|
35
|
+
def show
|
36
|
+
@filter = WcoEmail::EmailFilter.find params[:id]
|
37
|
+
authorize! :show, @filter
|
38
|
+
end
|
39
|
+
|
40
|
+
def update
|
41
|
+
@filter = WcoEmail::EmailFilter.find params[:id]
|
42
|
+
authorize! :update, @filter
|
43
|
+
|
44
|
+
if @filter.update email_filter_pparams
|
45
|
+
render json: { messages: [ 'Updated the email filter.' ] }, status: :ok
|
46
|
+
else
|
47
|
+
render json: { messages: @filter.errors.full_messages +
|
48
|
+
@filter.actions.map { |k| k.errors.full_messages } +
|
49
|
+
@filter.conditions.map { |k| k.errors.full_messages } +
|
50
|
+
@filter.skip_conditions.map { |k| k.errors.full_messages }
|
51
|
+
}, status: 400
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
## private
|
57
|
+
##
|
58
|
+
private
|
59
|
+
|
60
|
+
def email_filter_pparams
|
61
|
+
params[:email_filter].permit({
|
62
|
+
actions_attributes: [ :id, :_destroy, :kind, :value ],
|
63
|
+
conditions_attributes: [ :id, :_destroy, :field, :operator, :value ],
|
64
|
+
skip_conditions_attributes: [ :id, :_destroy, :field, :operator, :value ],
|
65
|
+
})
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
end
|
70
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
json.items do
|
3
|
+
json.array! @items do |item|
|
4
|
+
json.id item.id.to_s
|
5
|
+
json.name item.to_s
|
6
|
+
json.partial!( 'wco_email/api/email_filter_actions/index', items: item.actions )
|
7
|
+
json.partial!( 'wco_email/api/email_filter_conditions/index', items: item.conditions )
|
8
|
+
json.partial!( 'wco_email/api/email_filter_conditions/index', items: item.skip_conditions, name: 'skip_conditions' )
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
|
2
|
+
json.id @filter.id.to_s
|
3
|
+
json.name 'filter name'
|
4
|
+
json.partial! 'wco_email/api/email_filter_actions/index', items: @filter.actions
|
5
|
+
json.partial! 'wco_email/api/email_filter_conditions/index', items: @filter.conditions
|
6
|
+
json.partial! 'wco_email/api/email_filter_conditions/index', items: @filter.skip_conditions, name: 'skip_conditions'
|
@@ -3,6 +3,22 @@
|
|
3
3
|
.header
|
4
4
|
%h5.title Email Filter `#{@email_filter.id}`
|
5
5
|
|
6
|
+
%pre.descr
|
7
|
+
= @email_filter.to_s_full
|
8
|
+
%h5 Conditions
|
9
|
+
%ul
|
10
|
+
- @email_filter.conditions.each do |cond|
|
11
|
+
%li= cond.to_s_full
|
12
|
+
%h5 Skip conditions
|
13
|
+
%ul
|
14
|
+
- @email_filter.skip_conditions.each do |item|
|
15
|
+
%li= item.to_s_full
|
16
|
+
%h5 Actions
|
17
|
+
%ul
|
18
|
+
- @email_filter.actions.each do |item|
|
19
|
+
%li= item.to_s_full
|
20
|
+
|
21
|
+
%hr
|
6
22
|
%h5 Convs (#{@email_filter.conversations.length})
|
7
23
|
%ul
|
8
24
|
- @email_filter.conversations.each do |conv|
|
data/config/routes.rb
CHANGED
@@ -6,8 +6,15 @@ 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',
|
10
|
-
get 'api/conversations',
|
9
|
+
get 'api/contexts/summary', to: '/wco_email/api/contexts#summary'
|
10
|
+
get 'api/conversations', to: '/wco_email/api/conversations#index'
|
11
|
+
get 'api/email_action_templates', to: '/wco_email/api/email_action_templates#index'
|
12
|
+
get 'api/email_filters', to: '/wco_email/api/email_filters#index', defaults: { format: :json }
|
13
|
+
get 'api/email_filters/:id', to: '/wco_email/api/email_filters#show'
|
14
|
+
delete 'api/email_filters/:id', to: '/wco_email/api/email_filters#destroy'
|
15
|
+
post 'api/email_filters', to: '/wco_email/api/email_filters#create'
|
16
|
+
patch 'api/email_filters/:id', to: '/wco_email/api/email_filters#update'
|
17
|
+
get 'api/email_templates', to: '/wco_email/api/email_templates#index'
|
11
18
|
get 'api/tags/:tagname/conversations', to: '/wco_email/api/conversations#index'
|
12
19
|
|
13
20
|
get 'conversations/in/:tagname', to: '/wco_email/conversations#index', as: :conversations_in
|
@@ -31,7 +38,7 @@ WcoEmail::Engine.routes.draw do
|
|
31
38
|
post 'contexts/send_immediate/:id', to: 'contexts#send_immediate', as: :send_context
|
32
39
|
resources :contexts
|
33
40
|
|
34
|
-
get 'email_filters/new2', to: 'email_filters#new2'
|
41
|
+
get 'email_filters/new2', to: 'email_filters#new2', as: :new2_email_filter
|
35
42
|
resources :email_filters
|
36
43
|
resources :email_filter_conditions
|
37
44
|
|
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.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:
|
11
|
+
date: 2025-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -311,6 +311,9 @@ files:
|
|
311
311
|
- app/assets/stylesheets/wco_email/tags.scss
|
312
312
|
- app/controllers/wco_email/api/contexts_controller.rb
|
313
313
|
- app/controllers/wco_email/api/conversations_controller.rb
|
314
|
+
- app/controllers/wco_email/api/email_action_templates_controller.rb
|
315
|
+
- app/controllers/wco_email/api/email_filters_controller.rb
|
316
|
+
- app/controllers/wco_email/api/email_templates_controller.rb
|
314
317
|
- app/controllers/wco_email/api_controller.rb
|
315
318
|
- app/controllers/wco_email/application_controller.rb
|
316
319
|
- app/controllers/wco_email/contexts_controller.rb
|
@@ -370,6 +373,12 @@ files:
|
|
370
373
|
- app/views/wco_email/_sidebar.haml
|
371
374
|
- app/views/wco_email/api/contexts/summary.json.jbuilder
|
372
375
|
- app/views/wco_email/api/conversations/index.json.jbuilder
|
376
|
+
- app/views/wco_email/api/email_action_templates/index.json.jbuilder
|
377
|
+
- app/views/wco_email/api/email_filter_actions/_index.json.jbuilder
|
378
|
+
- app/views/wco_email/api/email_filter_conditions/_index.json.jbuilder
|
379
|
+
- app/views/wco_email/api/email_filters/index.json.jbuilder
|
380
|
+
- app/views/wco_email/api/email_filters/show.json.jbuilder
|
381
|
+
- app/views/wco_email/api/email_templates/index.json.jbuilder
|
373
382
|
- app/views/wco_email/contexts/_form.haml
|
374
383
|
- app/views/wco_email/contexts/_form_reply.haml
|
375
384
|
- app/views/wco_email/contexts/_header.haml
|