wco_email 0.1.1.4 → 0.1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61597801d89aaa1e36b55beaeea9acc706148ba6c1a83225770d979f02adc0b1
4
- data.tar.gz: ae4dbd6690ecf5c61efb0bc3e4937f7ba1a40134e6b0a0f95da8588478a2301c
3
+ metadata.gz: '0785f28263ba6e1e09e55e7c36cd7bb121fdd0d52e5f58773031166334c3f918'
4
+ data.tar.gz: 50fab8b519267f3ab8aedb7faaf2db717d214bfcce90316be2849b2b55fae16d
5
5
  SHA512:
6
- metadata.gz: caea37456ead2787bb43eafb68d24c342ce0a7ef2f308a20b384d0fa80a7668f2a3dca58784cae0963b742b68bd56f091db91110823ddb83ac83985dd7060104
7
- data.tar.gz: 75993b2dae7cca5d52992e76e24fe26b73496af6efe998ce2c287d6aab8efa7490dc89766ceb109c500ea8ed995bd8797070b0b659855327789cdb0e54353ad1
6
+ metadata.gz: 2812d3b69f9f59c43a820590942e8e376ab9af6ba85aa63d3509d57fd2913cf0254e7f42b5228a66d56644fd983decc04c89369df7b15f48f6b72a7485590ee0
7
+ data.tar.gz: fd157a0a5bae64f097b4738ac0038b19de2b924868f0f39b12b30a4bfe45f7f702e86209fafe6b03721aaf4e53d5870a16354fdb51a1d54b2d76b576d1a606c6
@@ -5,7 +5,7 @@ class WcoEmail::ApiController < ActionController::Base
5
5
  skip_before_action :verify_authenticity_token
6
6
 
7
7
  def create_email_message
8
- puts! params, 'params'
8
+ # puts! params, 'params'
9
9
 
10
10
  stub = WcoEmail::MessageStub.create!({
11
11
  bucket: params[:bucket],
@@ -9,8 +9,8 @@ class WcoEmail::ApplicationController < Wco::ApplicationController
9
9
  ##
10
10
  private
11
11
 
12
- def set_lists
13
- @tags = Wco::Tag.all
14
- end
12
+ # def set_lists
13
+ # @tags = Wco::Tag.all
14
+ # end
15
15
 
16
16
  end
@@ -129,7 +129,7 @@ class WcoEmail::ContextsController < WcoEmail::ApplicationController
129
129
  @ctx = WcoEmail::Context.find params[:id]
130
130
  authorize! :update, @ctx
131
131
 
132
- if @ctx.update_attributes params[:ctx].permit!
132
+ if @ctx.update_attributes params[:context].permit!
133
133
  flash[:notice] = 'Saved.'
134
134
  redirect_to action: 'edit', id: @ctx.id
135
135
  return
@@ -119,7 +119,7 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
119
119
  private
120
120
 
121
121
  def set_lists
122
- super
122
+ @tags = Wco::Tag.all
123
123
  @email_templates_list = [ [nil, nil] ] + WcoEmail::EmailTemplate.all.map { |tmpl| [ tmpl.slug, tmpl.id ] }
124
124
  @leads_list = Wco::Lead.list
125
125
  @tags_list = Wco::Tag.list
@@ -33,8 +33,8 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
33
33
 
34
34
  def index
35
35
  authorize! :index, WcoEmail::EmailFilter.new
36
- @email_filter = WcoEmail::EmailFilter.new
37
- @email_filters = WcoEmail::EmailFilter.active
36
+ @email_filter = WcoEmail::EmailFilter.new
37
+ @email_filters = WcoEmail::EmailFilter.all
38
38
  end
39
39
 
40
40
  def new
@@ -60,7 +60,7 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
60
60
  private
61
61
 
62
62
  def set_lists
63
- super
63
+ # super
64
64
  @email_templates_list = WcoEmail::EmailTemplate.list
65
65
  @email_actions_list = WcoEmail::EmailAction.list
66
66
  @email_action_templates_list = WcoEmail::EmailActionTemplate.list
@@ -3,7 +3,7 @@
3
3
 
4
4
  .email-contexts--form
5
5
  -# - url = ctx.new_record? ? contexts_path : context_path(ctx)
6
- = form_for ctx, as: :ctx do |f|
6
+ = form_for ctx, as: :context do |f|
7
7
 
8
8
  .flex-row
9
9
  = f.label "Template"
@@ -34,7 +34,7 @@
34
34
 
35
35
  .flex-row
36
36
  = f.label :reply_to_message
37
- = f.select :reply_to_message_id, options_for_select([[ ctx.reply_to_message.subject, ctx.reply_to_message_id ]], selected: ctx.reply_to_message_id), {}, class: 'w-100'
37
+ = f.select :reply_to_message_id, options_for_select([[ ctx.reply_to_message, ctx.reply_to_message_id ]], selected: ctx.reply_to_message_id), {}, class: 'w-100'
38
38
 
39
39
  .tab-labels.flex-row
40
40
  %a.label-raw{ href: "javascript: void(0)", data: { ref: '.tab-raw' } } Raw
@@ -2,4 +2,4 @@
2
2
  .email-contexts-new.maxwidth
3
3
  .header
4
4
  %h2.title New email context
5
- = render '/wco_email/email_contexts/form', ctx: @ctx
5
+ = render '/wco_email/contexts/form', ctx: @ctx
@@ -13,7 +13,8 @@
13
13
  <b>Template:</b> #{link_to @ctx.email_template.slug, email_template_path(@ctx.email_template), target: :_blank }
14
14
  %li <b>From:</b> #{@ctx.from_email}
15
15
  %li <b>To Lead:</b> #{link_to @ctx.lead.email, wco.lead_path(@ctx.lead)}
16
- %li <b>reply_to_message:</b> #{ link_to @ctx.reply_to_message, message_path(@ctx.reply_to_message), target: :_blank }
16
+ - if @ctx.reply_to_message
17
+ %li <b>reply_to_message:</b> #{ link_to @ctx.reply_to_message, message_path(@ctx.reply_to_message), target: :_blank }
17
18
 
18
19
 
19
20
  .col-md-4
@@ -24,4 +24,4 @@
24
24
  = render '/wco_email/messages/meta', message: msg
25
25
  %iframe.message-iframe{ src: message_iframe_path(msg) }
26
26
 
27
- = render '/wco_email/contexts/form_reply', lead_id: msg.lead_id, message: msg, ctx: WcoEmail::Context.new({ from_email: msg.to.downcase, subject: msg.subject })
27
+ = render '/wco_email/contexts/form_reply', lead_id: msg.lead_id, message: msg, ctx: WcoEmail::Context.new({ from_email: msg.to&.downcase, subject: msg.subject })
@@ -23,13 +23,15 @@
23
23
  %th Subject Exact
24
24
  %th Body Exact
25
25
  %th Kind
26
- %th Email Action
27
- %th Email Template
28
- %th Email Tag
29
- - @email_filters.each do |ef|
26
+ -# %th Email Action
27
+ %th Email Action Template
28
+ -# %th Email Tag
29
+ - @email_filters.each_with_index do |ef, idx|
30
30
 
31
31
  %tr
32
- %td= check_box_tag 'checked'
32
+ %td
33
+ .gray= idx+1
34
+ = check_box_tag 'checked'
33
35
  %td
34
36
  = link_to '[~]', edit_email_filter_path(ef)
35
37
  .inline-block= button_to '[x]', email_filter_path(ef), method: :delete, data: { confirm: 'Are you sure?' }
@@ -41,8 +43,8 @@
41
43
  %td= ef.subject_exact
42
44
  %td= ef.body_exact
43
45
  %td= ef.kind
44
- %td= ef.email_action&.slug
45
- %td= ef.email_template&.slug
46
- %td= ef.category&.name
46
+ -# %td= ef.email_action&.id
47
+ %td= ef.email_action_template&.slug
48
+ -# %td= ef.category&.name
47
49
 
48
50
 
@@ -0,0 +1,22 @@
1
+ [Unit]
2
+ Description=wco_email_rb_sidekiq
3
+
4
+ [Service]
5
+ Type=simple
6
+ User=root
7
+ WorkingDirectory=/opt/projects/micros_email/current
8
+ ExecStart=/root/.rbenv/shims/bundle exec sidekiq -q wco_email_rb -q wco_email_rb_mailers
9
+ ExecStop=/bin/echo nothing
10
+ Restart=on-failure
11
+ Environment=RAILS_ENV=production
12
+ Environment=RAILS_LOG_TO_STDOUT=true
13
+
14
+ StandardOutput=syslog
15
+ StandardError=syslog
16
+ SyslogIdentifier=wco_email_rb_sidekiq
17
+
18
+ # StandardOutput=append:/var/log/sidekiq/production.log
19
+ # StandardError=append:/var/log/sidekiq/production.log
20
+
21
+ [Install]
22
+ WantedBy=multi-user.target
@@ -1,4 +1,26 @@
1
1
 
2
+ =begin
3
+
4
+
5
+ ## clean
6
+ WcoEmail::EmailAction.each do |act|
7
+ if !act.lead
8
+ act.delete
9
+ end
10
+ end
11
+
12
+
13
+
14
+ ## clean
15
+ WcoEmail::Context.each do |ttt|
16
+ if !ttt.lead
17
+ ttt.delete
18
+ end
19
+ end
20
+
21
+
22
+ =end
23
+
2
24
  namespace :db do
3
25
 
4
26
  desc "seed"
@@ -31,7 +31,7 @@ namespace :wco_email do
31
31
  stub.config = JSON.parse( stub.config ).merge({ process_images: process_images, skip_notification: true }).to_json
32
32
  stub.save!
33
33
 
34
- WcoEmail::MessageIntakeJob.perform_sync( stub.id.to_s )
34
+ WcoEmail::MessageIntakeJob.perform_async( stub.id.to_s )
35
35
  end
36
36
  end
37
37
 
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
4
+ version: 0.1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -450,6 +450,7 @@ files:
450
450
  - app/views/wco_email/unsubscribes/_table.haml
451
451
  - config/initializers/assets.rb
452
452
  - config/routes.rb
453
+ - lib/systemd/system/wco_email_sidekiq.service
453
454
  - lib/tasks/bjjcollective/sitemap.rb
454
455
  - lib/tasks/db_tasks.rake
455
456
  - lib/tasks/direct_mail_tasks.rake
@@ -462,8 +463,6 @@ files:
462
463
  - lib/tasks/wasya_co/sitemap.rb
463
464
  - lib/tasks/wco_email_tasks.rake
464
465
  - lib/wco_email.rb
465
- - lib/wco_email/README_email_actions.rb
466
- - lib/wco_email/README_email_contexts.rb
467
466
  - lib/wco_email/engine.rb
468
467
  homepage: https://wasya.co
469
468
  licenses:
@@ -1,7 +0,0 @@
1
-
2
- ## clean
3
- WcoEmail::EmailAction.each do |act|
4
- if !act.lead
5
- act.delete
6
- end
7
- end
@@ -1,7 +0,0 @@
1
-
2
- ## clean
3
- WcoEmail::Context.each do |ttt|
4
- if !ttt.lead
5
- ttt.delete
6
- end
7
- end