wco_email 0.1.1.9 → 0.1.1.11

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: e57ecd1bf1d0b46720dcccaa03f2d64dd5f2cdad1f388deb3c8911dd0aa6d356
4
- data.tar.gz: 13b0c8d1e091583953a55c4df15649ad013941d2edf55490daa291e1b2a6b705
3
+ metadata.gz: 57871044dbe34a83eb21daf21efce6e5f80f58a4d05002e335a5de68708c9db2
4
+ data.tar.gz: e3813b3170e891df5f8d49168b319823f7eaa935ca4aa2f4e21606eba5cbf49c
5
5
  SHA512:
6
- metadata.gz: 95cea1283f602b863a91c45fa6a8d0fe0ac1ed4a719a4b4acbe6466b7553efdff646e4f990b2653d6cd692e9c7181dceab79004440cd147e1ec8f5e7e4b751fb
7
- data.tar.gz: e549dec48e17c1aa283ed2163c6bf52937bca3a5bf14b5d6a4c1b261fab888a45bff52f97cd5590e73940b6eda76ddff10c1278e5d4676cc27bf423c6b67bf87
6
+ metadata.gz: 67012b8a6f4a425ebc669e3b31aef2ae94305e59774052e1e122a98f9f1878a48d890dca3f2f1661e0a53e818abe76bfe4565b85c7c5e9bd9517c60d46e49750
7
+ data.tar.gz: e1958e70b7e6f17f4c3507dee615fd21567385d51097b51cbdaafd4493f76a40b7c94eae06e6da3057db4c2b54bbd0717157fe94e51e9ae0225c15acb3c3db50
@@ -34,7 +34,7 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
34
34
  def index
35
35
  authorize! :index, WcoEmail::EmailFilter.new
36
36
  @email_filter = WcoEmail::EmailFilter.new
37
- @email_filters = WcoEmail::EmailFilter.all
37
+ @email_filters = WcoEmail::EmailFilter.all.page( params[WcoEmail::EmailFilter::PAGE_PARAM_NAME] ).per( current_profile.per_page )
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
+ @tags_list = Wco::Tag.list
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
@@ -2,6 +2,7 @@
2
2
  require 'aws-sdk-s3'
3
3
  require 'mail'
4
4
  require 'sidekiq'
5
+ require 'exception_notification'
5
6
 
6
7
  ##
7
8
  ## 2023-02-26 _vp_ Let's go
@@ -40,7 +41,7 @@ class WcoEmail::MessageIntakeJob
40
41
  stub.do_process
41
42
  rescue => err
42
43
  puts! err, "WcoEmail::MessageIntakeJob error"
43
- ExceptionNotifier.notify_exception(
44
+ ::ExceptionNotifier.notify_exception(
44
45
  err,
45
46
  data: { stub: stub }
46
47
  )
@@ -6,7 +6,7 @@
6
6
 
7
7
  .flex-row
8
8
  = f.label :email_template_id
9
- = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || ctx.email_template_id || blank_tmpl_id ), {}, { class: 'select2', required: true }
9
+ = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || ctx.email_template_id ), {}, { class: 'select2', required: true }
10
10
  - if ctx.email_template_id
11
11
  = link_to '[view]', email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
12
12
  = link_to '[~]', edit_email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
@@ -33,8 +33,8 @@
33
33
  .field
34
34
  = f.label :email_action_template
35
35
  = f.select :email_action_template, options_for_select( @email_action_templates_list, selected: email_filter.email_action_template ), {}, class: 'select2'
36
- -# .field
37
- -# = f.label :wp_term_id
38
- -# = f.select :wp_term_id, options_for_select( @email_tags_list, selected: email_filter.wp_term_id ), {}, class: 'select2'
36
+ .field
37
+ = f.label :tag
38
+ = f.select :tag, options_for_select( @tags_list, selected: email_filter.tag_id ), {}, class: 'select2'
39
39
  .actions
40
40
  = f.submit
@@ -12,6 +12,7 @@
12
12
  = render 'form', email_filter: @email_filter
13
13
  %hr
14
14
 
15
+ = paginate @email_filters, param_name: WcoEmail::EmailFilter::PAGE_PARAM_NAME, views_prefix: 'wco'
15
16
  %table.bordered.data-table
16
17
  %thead
17
18
  %tr
@@ -23,9 +24,9 @@
23
24
  %th Subject Exact
24
25
  %th Body Exact
25
26
  %th Kind
26
- -# %th Email Action
27
- %th Email Action Template
28
- -# %th Email Tag
27
+ %th Respond with <br />Email Template
28
+ %th Email Action <br />(template)
29
+ %th Tag
29
30
  - @email_filters.each_with_index do |ef, idx|
30
31
 
31
32
  %tr
@@ -43,8 +44,8 @@
43
44
  %td= ef.subject_exact
44
45
  %td= ef.body_exact
45
46
  %td= ef.kind
46
- -# %td= ef.email_action&.id
47
+ %td= ef.email_template&.slug
47
48
  %td= ef.email_action_template&.slug
48
- -# %td= ef.category&.name
49
+ %td= ef.tag&.slug
49
50
 
50
51
 
@@ -93,22 +93,24 @@ namespace :wco_email do
93
93
  desc 'import objectkey list'
94
94
  task import_objectkey_list: :environment do
95
95
 
96
- bucket = 'ish-ses'
96
+ # bucket = 'ish-ses'
97
+ bucket = 'ish-test-2024'
97
98
  client ||= Aws::S3::Client.new({
98
99
  region: ::S3_CREDENTIALS[:region_ses],
99
100
  access_key_id: ::S3_CREDENTIALS[:access_key_id_ses],
100
101
  secret_access_key: ::S3_CREDENTIALS[:secret_access_key_ses],
101
102
  })
102
103
 
103
- lines = File.read( './data/20240110_ish-ses_objectkeys' )
104
+ # lines = File.read( './data/20240110_ish-ses_objectkeys' )
105
+ lines = File.read( './data/out_head' )
104
106
  lines.split("\n").each_with_index do |line, idx|
105
107
 
106
108
  object_key = line.split.last
107
109
  stub = WcoEmail::MessageStub.create( object_key: object_key, bucket: bucket )
108
110
  if stub.persisted?
109
- print "#{idx}."
111
+ print "#{idx+1}."
110
112
  else
111
- outs! stub.errors.full_messages.join(", ")
113
+ puts! stub.errors.full_messages.join(", ")
112
114
  end
113
115
 
114
116
  end
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.9
4
+ version: 0.1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -317,7 +317,6 @@ files:
317
317
  - app/controllers/wco_email/unsubscribes_controller.rb
318
318
  - app/helpers/wco_email/application_helper.rb
319
319
  - app/jobs/wco_email/message_intake_job.rb
320
- - app/mailers/wco_email/application_mailer.rb
321
320
  - app/views/202212 Mailchimp Templates/202212 1col fixed-width.html
322
321
  - app/views/202212 Mailchimp Templates/202212 1col full-width.html
323
322
  - app/views/202212 Mailchimp Templates/202212 2col fixed-width 2.html
@@ -355,13 +354,12 @@ files:
355
354
  - app/views/202310 Email Templates/_acknowledgement_of_document_receipt.html.erb
356
355
  - app/views/202310 Email Templates/_support_ticket_created.html.erb
357
356
  - app/views/layouts/wco_email/application.haml
358
- - app/views/layouts/wco_email/mailbox.haml-trash
359
357
  - app/views/wco_email/_analytics.erb
360
358
  - app/views/wco_email/_main_header.haml
361
359
  - app/views/wco_email/_sidebar.haml
362
360
  - app/views/wco_email/application_mailer/_footer_unsubscribe.html.erb
363
361
  - app/views/wco_email/application_mailer/_header_logo.html.erb
364
- - app/views/wco_email/application_mailer/forwarder_notify.html.erb
362
+ - app/views/wco_email/application_mailer/forwarder_notify.html.erb-trash
365
363
  - app/views/wco_email/contexts/_form.haml
366
364
  - app/views/wco_email/contexts/_form_reply.haml
367
365
  - app/views/wco_email/contexts/_header.haml
@@ -1,98 +0,0 @@
1
-
2
- class WcoEmail::ApplicationMailer < ActionMailer::Base
3
-
4
- default from: 'WasyaCo Consulting <no-reply@wco.com.de>'
5
- helper(Wco::ApplicationHelper)
6
-
7
- layout 'mailer'
8
-
9
-
10
- def forwarder_notify msg_id
11
- @msg = WcoEmail::Message.find msg_id
12
- mail( to: "poxlovi@gmail.com",
13
- subject: "POX::#{@msg.subject}" )
14
- end
15
-
16
- def shared_galleries profiles, gallery
17
- return if profiles.count == 0
18
- @gallery = gallery
19
- @domain = Rails.application.config.action_mailer.default_url_options[:host]
20
- @galleries_path = IshManager::Engine.routes.url_helpers.galleries_path
21
- @gallery_path = IshManager::Engine.routes.url_helpers.gallery_path(@gallery.slug)
22
- mail( :to => '314658@gmail.com',
23
- :bcc => profiles.map { |p| p.email },
24
- :subject => 'You got new shared galleries on pi manager' )
25
- end
26
-
27
- def option_alert option
28
- @option = option
29
- mail({
30
- :to => option.profile.email,
31
- :subject => "IshManager Option Alert :: #{option.ticker}",
32
- })
33
- end
34
-
35
- def stock_alert watch_id
36
- @watch = Iro::OptionWatch.find watch_id
37
- mail({
38
- to: @watch.profile.email,
39
- subject: "Iro Watch Alert :: #{@watch.ticker} is #{@watch.direction} #{@watch.mark}."
40
- })
41
- end
42
-
43
- def test_email
44
- mail( to: DEFAULT_RECIPIENT, subject: "Test email at #{Time.now}" )
45
- end
46
-
47
- ## 2023-04-02 _vp_ Continue.
48
- ## 2023-09-24 _vp_ Continue : )
49
- def send_context_email ctx_id
50
- @ctx = Ctx.find ctx_id
51
- @lead = Wco::Lead.find @ctx.lead_id
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
- # @origin = "https://#{Rails.application.config.action_mailer.default_url_options[:host]}"
62
-
63
- @unsubscribe_url = WcoEmail::Engine.routes.url_helpers.unsubscribes_url({
64
- template_id: @ctx.tmpl.id,
65
- lead_id: @lead.id,
66
- token: @lead.unsubscribe_token,
67
- host: Rails.application.routes.default_url_options[:host],
68
- })
69
- # renderer = Tmp6Ctl.new
70
- # renderer = IshManager::ApplicationController.new
71
- # renderer.send( :include, ::IshManager::ApplicationHelper )
72
- # renderer.send( :request, { host: 'test-host' } )
73
- renderer = WcoEmail::ApplicationMailer.new
74
-
75
- renderer.instance_variable_set( :@ctx, @ctx )
76
- renderer.instance_variable_set( :@lead, @ctx.lead )
77
- renderer.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
78
- renderer.instance_variable_set( :@unsubscribe_url, @unsubscribe_url )
79
- renderer.instance_variable_set( :@tmpl_config, @tmpl_config )
80
-
81
- # eval( @ctx.tmpl.config_exe )
82
-
83
- rendered_str = renderer.render_to_string("/wco_email/email_templates/_#{@ctx.tmpl.layout}")
84
- @ctx.update({
85
- rendered_str: rendered_str,
86
- sent_at: Time.now.to_s,
87
- })
88
-
89
- mail( from: @ctx.from_email,
90
- to: @ctx.to_email,
91
- cc: @ctx.cc,
92
- bcc: "poxlovi@gmail.com",
93
- subject: ERB.new( @ctx.subject ).result( @ctx.get_binding ),
94
- body: rendered_str,
95
- content_type: "text/html" )
96
- end
97
-
98
- end
@@ -1,62 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title #{@page_title} | wco_email_rb-mailbox
5
- %link{ :rel => 'icon', :href => "/favicon_#{ENV['RAILS_ENV']}.gif" }
6
- %meta{ :name => :viewport, :content => 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=2' }
7
- %meta{ :charset => 'UTF-8' }
8
- %meta{ :description => @page_description }
9
-
10
- = javascript_include_tag "//code.jquery.com/jquery-3.3.1.min.js"
11
-
12
- %script{ :src => "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" }
13
- = stylesheet_link_tag "//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
14
-
15
- = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
16
- = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
17
-
18
- = stylesheet_link_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
19
- = javascript_include_tag "//cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"
20
- = javascript_include_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
21
-
22
- = stylesheet_link_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/css/select2.min.css"
23
- = javascript_include_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/js/select2.min.js"
24
-
25
- -# summernote
26
- = stylesheet_link_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css"
27
- = javascript_include_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"
28
- -# quill core
29
- -# = stylesheet_link_tag "//cdn.quilljs.com/1.3.6/quill.core.css"
30
- -# = javascript_include_tag "//cdn.quilljs.com/1.3.6/quill.core.js"
31
- -# quill
32
- -# = stylesheet_link_tag "//cdn.quilljs.com/1.3.6/quill.snow.css"
33
- -# = javascript_include_tag "//cdn.quilljs.com/1.3.6/quill.min.js"
34
-
35
- = javascript_include_tag "wco_email/application"
36
- = stylesheet_link_tag "wco_email/application", media: "all"
37
- = stylesheet_link_tag "wco/application", media: "all"
38
-
39
- -# %script{crossorigin: "", src: "https://unpkg.com/react@18/umd/react.development.js"}
40
- -# %script{crossorigin: "", src: "https://unpkg.com/react-dom@18/umd/react-dom.development.js"}
41
- -# %script{src: "https://unpkg.com/prop-types@15.6/prop-types.min.js"}
42
- -# %script{src: "https://unpkg.com/axios/dist/axios.min.js"}
43
- -# %script{src: "https://unpkg.com/recharts/umd/Recharts.js"}
44
-
45
- = csrf_meta_tags
46
- %body{ class: [ params[:controller].gsub("wco_email/",""), "#{params[:controller].gsub("wco_email/","")}-#{params[:action]}", params[:action], "application-fullwidth" ] }
47
-
48
- = render "/wco/main_header"
49
- = render "/wco_email/main_header"
50
- = render '/wco/alerts_notices' if notice || alert
51
- %hr
52
-
53
- .padded
54
- .row
55
- .col-md-2.border-right
56
- = render 'wco_email/sidebar'
57
- .col-md-10
58
- %span.absolute.collapse-expand#mainW
59
- = yield
60
-
61
- = render '/wco/main_footer'
62
- = render '/wco_email/analytics' if Rails.env.production?