wco_email 0.1.1.124 → 0.1.1.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/wco_email/email_filters_controller.rb +1 -10
- data/app/controllers/wco_email/message_stubs_controller.rb +5 -1
- data/app/views/wco_email/email_filters/_form.haml +24 -64
- data/app/views/wco_email/email_filters/_header.haml +0 -2
- data/app/views/wco_email/email_filters/_main_header.haml +0 -1
- data/app/views/wco_email/email_filters/index.haml +1 -40
- metadata +1 -4
- data/app/views/wco_email/email_filters/_form2.haml +0 -37
- data/app/views/wco_email/email_filters/edit2.haml +0 -5
- data/app/views/wco_email/email_filters/new2.haml +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1bf2788c045ff34048778ba9c2e740dd7ebc71adfbb867edbc2e5f3394689e1
|
|
4
|
+
data.tar.gz: f0b5f64fc3c7bafebbd18872e674e7ad59e6710ac698a6f8876852d25a536f86
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: adebaef5a30c069b4932f977694505b5b0b07ee40203c42aa9a50c37d92209ffbb6fb2aba5173806610209c2875998399c5a1e6b0936394a3f8fb82c7fcb55d0
|
|
7
|
+
data.tar.gz: b32a2e4b9d2eaae4ccdcb45856f753bacf6c1d854cee5719f80eb95c425aea8547438f1cad8ccb574d2f329338c339767212b7643fe02d416a075463db7832f9
|
|
@@ -45,10 +45,6 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def edit
|
|
48
|
-
@email_filter = WcoEmail::EmailFilter.find params[:id]
|
|
49
|
-
authorize! :edit, @email_filter
|
|
50
|
-
end
|
|
51
|
-
def edit2
|
|
52
48
|
@email_filter = WcoEmail::EmailFilter.find( params[:id] )
|
|
53
49
|
authorize! :edit, @email_filter
|
|
54
50
|
|
|
@@ -65,11 +61,10 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
|
|
|
65
61
|
}
|
|
66
62
|
end
|
|
67
63
|
|
|
68
|
-
|
|
69
64
|
def index
|
|
70
65
|
authorize! :index, WcoEmail::EmailFilter.new
|
|
71
66
|
@email_filter = WcoEmail::EmailFilter.new
|
|
72
|
-
@email_filters = WcoEmail::EmailFilter.all.includes( :
|
|
67
|
+
@email_filters = WcoEmail::EmailFilter.all.includes( :conversations )
|
|
73
68
|
|
|
74
69
|
if params[:q]
|
|
75
70
|
filter_ids = WcoEmail::EmailFilterCondition.where( value: /#{params[:q]}/i ).distinct(:email_filter_id)
|
|
@@ -83,10 +78,6 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
|
|
|
83
78
|
def new
|
|
84
79
|
@email_filter = WcoEmail::EmailFilter.new
|
|
85
80
|
authorize! :new, @email_filter
|
|
86
|
-
end
|
|
87
|
-
def new2
|
|
88
|
-
@email_filter = WcoEmail::EmailFilter.new
|
|
89
|
-
authorize! :new, @email_filter
|
|
90
81
|
|
|
91
82
|
@email_filter.conditions.build
|
|
92
83
|
@email_filter.skip_conditions.build
|
|
@@ -66,7 +66,11 @@ class WcoEmail::MessageStubsController < WcoEmail::ApplicationController
|
|
|
66
66
|
authorize! :show, @stub
|
|
67
67
|
|
|
68
68
|
@client ||= Aws::S3::Client.new(::SES_S3_CREDENTIALS)
|
|
69
|
-
|
|
69
|
+
if 'json' == @stub.format
|
|
70
|
+
@json = JSON.parse( @client.get_object( bucket: @stub.bucket, key: @stub.object_key ).body.read )
|
|
71
|
+
else
|
|
72
|
+
@json = @client.get_object( bucket: @stub.bucket, key: @stub.object_key ).body.read
|
|
73
|
+
end
|
|
70
74
|
end
|
|
71
75
|
|
|
72
76
|
def update
|
|
@@ -1,77 +1,37 @@
|
|
|
1
1
|
|
|
2
2
|
-##
|
|
3
|
-
-## 2024-04-13
|
|
3
|
+
-## 2024-04-13 Introducing email_filter_condition
|
|
4
4
|
-##
|
|
5
5
|
|
|
6
6
|
- url = email_filter.new_record? ? email_filters_path : email_filter_path( email_filter )
|
|
7
|
-
.email-filters--from
|
|
7
|
+
.email-filters--from.maxwidth
|
|
8
8
|
= form_for email_filter, url: url, as: :email_filter do |f|
|
|
9
|
-
.actions
|
|
10
|
-
= f.submit
|
|
11
9
|
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.field
|
|
18
|
-
%label From Exact
|
|
19
|
-
= f.text_field :from_exact
|
|
20
|
-
.field
|
|
21
|
-
%label Subject Regex
|
|
22
|
-
= f.text_field :subject_regex
|
|
23
|
-
.field
|
|
24
|
-
%label Subject Exact
|
|
25
|
-
= f.text_field :subject_exact
|
|
26
|
-
-# .field
|
|
27
|
-
-# %label Body Regex
|
|
28
|
-
-# = f.text_field :body_regex
|
|
29
|
-
.field
|
|
30
|
-
%label Body Exact
|
|
31
|
-
= f.text_field :body_exact
|
|
32
|
-
.col-md-6
|
|
10
|
+
.d-flex
|
|
11
|
+
%label slug
|
|
12
|
+
= f.text_field :slug, class: 'flex-grow'
|
|
13
|
+
%label status
|
|
14
|
+
= f.select :status, options_for_select([ 'active', 'inactive' ], selected: email_filter.status )
|
|
33
15
|
|
|
34
|
-
.field
|
|
35
|
-
%label Kind
|
|
36
|
-
= f.select :kind, options_for_select( WcoEmail::EmailFilter::KINDS, selected: email_filter.kind )
|
|
37
|
-
.field
|
|
38
|
-
%label Email Template
|
|
39
|
-
= f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || email_filter.email_template_id ), {}, { class: 'select2' }
|
|
40
|
-
.field
|
|
41
|
-
%label Email Action Template
|
|
42
|
-
= f.select :email_action_template_id, options_for_select( @email_action_templates_list, selected: email_filter.email_action_template_id ), {}, class: 'select2'
|
|
43
|
-
.field
|
|
44
|
-
%label Office Action Template
|
|
45
|
-
= f.select :office_action_template_id, options_for_select( ::Wco::OfficeActionTemplate.list, selected: email_filter.office_action_template_id ), {}, class: 'select2'
|
|
46
16
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
17
|
+
%label.collapse-expand#if_ <> If (any)
|
|
18
|
+
%ol
|
|
19
|
+
= f.fields_for( :conditions ) do |f_cond|
|
|
20
|
+
%li= render '/wco_email/email_filter_conditions/form', f: f_cond, cond: f_cond.object
|
|
21
|
+
.c
|
|
50
22
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
%label skip from regex
|
|
57
|
-
= f.text_field :skip_from_regex
|
|
23
|
+
%label.collapse-expand#skip_ <> Skip (any)
|
|
24
|
+
%ol
|
|
25
|
+
= f.fields_for( :skip_conditions ) do |f_cond|
|
|
26
|
+
%li= render '/wco_email/email_filter_conditions/form', f: f_cond, cond: f_cond.object
|
|
27
|
+
.c
|
|
58
28
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-# = f.fields_for( :conditions ) do |f_cond|
|
|
65
|
-
-# = render '/wco_email/email_filter_conditions/form', cond: cond, f: f_cond
|
|
29
|
+
%label.collapse-expand#then_ <> Then
|
|
30
|
+
%ol
|
|
31
|
+
= f.fields_for( :actions ) do |f_action|
|
|
32
|
+
%li= render '/wco_email/email_filter_actions/form', f: f_action, action: f_action.object
|
|
33
|
+
.c
|
|
66
34
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-# %ul
|
|
70
|
-
-# - email_filter.skip_conditions.each do |cond|
|
|
71
|
-
-# %li
|
|
72
|
-
-# = f.fields_for( :skip_conditions ) do |f_cond|
|
|
73
|
-
-# = render '/wco_email/email_filter_conditions/form', cond: cond, f: f_cond
|
|
35
|
+
.actions
|
|
36
|
+
= f.submit 'Go'
|
|
74
37
|
|
|
75
|
-
.col-12
|
|
76
|
-
.actions
|
|
77
|
-
= f.submit
|
|
@@ -3,7 +3,5 @@
|
|
|
3
3
|
%h5.title.text-center
|
|
4
4
|
= link_to '[~]', wco_email.edit_email_filter_path( @email_filter )
|
|
5
5
|
|
|
6
|
-
= link_to '[~2]', wco_email.edit2_email_filter_path( @email_filter )
|
|
7
|
-
|
|
8
6
|
= link_to 'Email Filter', wco_email.email_filter_path( @email_filter )
|
|
9
7
|
`#{@email_filter.id}`
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
%h2.title
|
|
5
5
|
Email Filters (#{@email_filters.length})
|
|
6
6
|
= link_to '[+]', new_email_filter_path
|
|
7
|
-
= link_to '[2+]', new2_email_filter_path
|
|
8
7
|
|
|
9
8
|
.actions.d-flex
|
|
10
9
|
.a.mr-2= button_tag 'Delete', method: :delete, class: 'delete-btn'
|
|
@@ -22,12 +21,7 @@
|
|
|
22
21
|
%th status
|
|
23
22
|
%th n convs
|
|
24
23
|
%th slug
|
|
25
|
-
%th
|
|
26
|
-
%th Match
|
|
27
|
-
%th Skip
|
|
28
|
-
%th Kind
|
|
29
|
-
-# %th Conditions
|
|
30
|
-
-# %th Skip Conditions
|
|
24
|
+
%th to_s_ful
|
|
31
25
|
|
|
32
26
|
- @email_filters.each_with_index do |ef, idx|
|
|
33
27
|
|
|
@@ -38,7 +32,6 @@
|
|
|
38
32
|
%td
|
|
39
33
|
.flex-row
|
|
40
34
|
= link_to '[~]', edit_email_filter_path(ef)
|
|
41
|
-
= link_to '[~2]', edit2_email_filter_path(ef)
|
|
42
35
|
= link_to '[view]', email_filter_path(ef)
|
|
43
36
|
.inline-block= button_to '[x]', email_filter_path(ef), method: :delete, data: { confirm: 'Are you sure?' }
|
|
44
37
|
.gray.small= ef.id
|
|
@@ -50,38 +43,6 @@
|
|
|
50
43
|
= ef.slug
|
|
51
44
|
%td.to_s_full
|
|
52
45
|
%pre= ef.to_s_full
|
|
53
|
-
%td.match
|
|
54
|
-
- if ef.from_regex.present?
|
|
55
|
-
.a <b>from_regex:</b> `#{ef.from_regex}`
|
|
56
|
-
- if ef.from_exact.present?
|
|
57
|
-
.a <b>from_exact:</b> `#{ef.from_exact}`
|
|
58
|
-
- if ef.subject_regex.present?
|
|
59
|
-
.a <b>subject_regex:</b> `#{ef.subject_regex}`
|
|
60
|
-
- if ef.subject_exact.present?
|
|
61
|
-
.a <b>subject_exact:</b> `#{ef.subject_exact}`
|
|
62
|
-
- if ef.body_exact.present?
|
|
63
|
-
.a <b>body_exact:</b> `#{ef.body_exact}`
|
|
64
|
-
|
|
65
|
-
%td.skip
|
|
66
|
-
- if ef.skip_to_exact.present?
|
|
67
|
-
.a <b>skip_to_exact:</b> `#{ef.skip_to_exact}`
|
|
68
|
-
- if ef.skip_from_regex.present?
|
|
69
|
-
.a <b>skip_from_regex:</b> `#{ef.skip_from_regex}`
|
|
70
|
-
|
|
71
|
-
%td.action
|
|
72
|
-
- if ef.kind == EF::KIND_AUTORESPOND_TMPL
|
|
73
|
-
.a <b>#{EF::KIND_AUTORESPOND_TMPL}:</b> #{ef.email_template&.slug}
|
|
74
|
-
- if ef.kind == EF::KIND_AUTORESPOND_EACT
|
|
75
|
-
.a <b>#{EF::KIND_AUTORESPOND_EACT}:</b> #{ef.email_action_template&.slug}
|
|
76
|
-
- if ef.kind == EF::KIND_ADD_TAG
|
|
77
|
-
.a <b>#{EF::KIND_ADD_TAG}:</b> #{ef.tag&.slug}
|
|
78
|
-
- if ef.kind == EF::KIND_REMOVE_TAG
|
|
79
|
-
.a <b>#{EF::KIND_REMOVE_TAG}:</b> #{ef.tag&.slug}
|
|
80
|
-
|
|
81
|
-
-# %td.conditions
|
|
82
|
-
-# = ef.conditions.length
|
|
83
|
-
-# %td.skip-conditions
|
|
84
|
-
-# = ef.skip_conditions.length
|
|
85
46
|
|
|
86
47
|
= paginate @email_filters, param_name: WcoEmail::EmailFilter::PAGE_PARAM_NAME, views_prefix: 'wco'
|
|
87
48
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.126
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Victor Pudeyev
|
|
@@ -426,16 +426,13 @@ files:
|
|
|
426
426
|
- app/views/wco_email/email_filter_actions/_form.haml
|
|
427
427
|
- app/views/wco_email/email_filter_conditions/_form.haml
|
|
428
428
|
- app/views/wco_email/email_filters/_form.haml
|
|
429
|
-
- app/views/wco_email/email_filters/_form2.haml
|
|
430
429
|
- app/views/wco_email/email_filters/_header.haml
|
|
431
430
|
- app/views/wco_email/email_filters/_list.haml
|
|
432
431
|
- app/views/wco_email/email_filters/_main_header.haml
|
|
433
432
|
- app/views/wco_email/email_filters/_show.haml
|
|
434
433
|
- app/views/wco_email/email_filters/edit.haml
|
|
435
|
-
- app/views/wco_email/email_filters/edit2.haml
|
|
436
434
|
- app/views/wco_email/email_filters/index.haml
|
|
437
435
|
- app/views/wco_email/email_filters/new.haml
|
|
438
|
-
- app/views/wco_email/email_filters/new2.haml
|
|
439
436
|
- app/views/wco_email/email_filters/show.haml
|
|
440
437
|
- app/views/wco_email/email_templates/_form.haml
|
|
441
438
|
- app/views/wco_email/email_templates/_form_mini.haml
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
-##
|
|
3
|
-
-## 2024-04-13 Introducing email_filter_condition
|
|
4
|
-
-##
|
|
5
|
-
|
|
6
|
-
- url = email_filter.new_record? ? email_filters_path : email_filter_path( email_filter )
|
|
7
|
-
.email-filters--from.maxwidth
|
|
8
|
-
= form_for email_filter, url: url, as: :email_filter do |f|
|
|
9
|
-
|
|
10
|
-
.d-flex
|
|
11
|
-
%label slug
|
|
12
|
-
= f.text_field :slug, class: 'flex-grow'
|
|
13
|
-
%label status
|
|
14
|
-
= f.select :status, options_for_select([ 'active', 'inactive' ], selected: email_filter.status )
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
%label.collapse-expand#if_ <> If (any)
|
|
18
|
-
%ol
|
|
19
|
-
= f.fields_for( :conditions ) do |f_cond|
|
|
20
|
-
%li= render '/wco_email/email_filter_conditions/form', f: f_cond, cond: f_cond.object
|
|
21
|
-
.c
|
|
22
|
-
|
|
23
|
-
%label.collapse-expand#skip_ <> Skip (any)
|
|
24
|
-
%ol
|
|
25
|
-
= f.fields_for( :skip_conditions ) do |f_cond|
|
|
26
|
-
%li= render '/wco_email/email_filter_conditions/form', f: f_cond, cond: f_cond.object
|
|
27
|
-
.c
|
|
28
|
-
|
|
29
|
-
%label.collapse-expand#then_ <> Then
|
|
30
|
-
%ol
|
|
31
|
-
= f.fields_for( :actions ) do |f_action|
|
|
32
|
-
%li= render '/wco_email/email_filter_actions/form', f: f_action, action: f_action.object
|
|
33
|
-
.c
|
|
34
|
-
|
|
35
|
-
.actions
|
|
36
|
-
= f.submit 'Go'
|
|
37
|
-
|