wco_email 0.1.1.8 → 0.1.1.10

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: 5cb594372790e81db691120124ed8941ce1f25325f7b38a34ad572d473992a16
4
- data.tar.gz: b0912e04e796b7ba376f19400d54cf216f2750853dcb39114a283629bc7b6a86
3
+ metadata.gz: d5e0454d0fd76de0c619c9ea26e84ce685f648e8441c39dacbe89b05fcc21e1a
4
+ data.tar.gz: 44b968d0696f37d5375e24c96139ed6aec53ac3f3d77c75d3b9b227f52180e99
5
5
  SHA512:
6
- metadata.gz: d52986031ee908e382886d14cb37e005ddaa789f49d05b81e844e34613b73d9d6fa8b9775bcff980c3a95f85a569ff3e9c2b10d53c00d603267133d0d332f8ef
7
- data.tar.gz: 0c9e01f40cd3ebd04b8323df18d01272b865e8ac3069bc0dcb2e87a81f0f0cc5deb173ad24da1482f710ad5e5a9f1566856b74400ef0b3ff54d0222314f77a30
6
+ metadata.gz: 868ea88e638147cbba1c6b51a298dadde124c59a31082aa7c96ac71b0dd6fa9998fe4868c5e36d138616101aa0f89b0eac7376098874f199d2ca48afacb5943f
7
+ data.tar.gz: dc02b95154d45c05d52a9ef41d4fe6a1508abac22e63df18dc3b15cf1105ca0d01b248cfa29546a0a32a9f0b3b6aae44af2020bc1d1c73761179ddffb6d524bf
@@ -1,9 +1,16 @@
1
1
  //
2
- // require rails-ujs
2
+ // trash: require rails-ujs
3
3
  //
4
- // require wco/application
5
- // require ./contexts
6
- // require ./conversations
4
+ //= require ./contexts
5
+ //= require ./conversations
7
6
  //
8
7
 
9
- console.log('loaded wco_email/application.js')
8
+ $(function () {
9
+
10
+ if ($(".tinymce").length > 0) {
11
+ $(".tinymce").summernote()
12
+ }
13
+
14
+ logg('loaded wco_email/application.js')
15
+ }) // END
16
+
@@ -16,4 +16,5 @@ $(document).ready(() => {
16
16
  })
17
17
  }
18
18
 
19
- })
19
+ logg('loaded wco_email/contexts.js')
20
+ }) // END
@@ -7,7 +7,8 @@
7
7
  .email-templates--form {
8
8
  form {
9
9
  > .actions {
10
- text-align: right;
10
+ display: flex;
11
+ justify-content: space-between;
11
12
  }
12
13
 
13
14
  .tab-labels {
@@ -31,6 +32,9 @@
31
32
 
32
33
  }
33
34
  .tabs {
35
+ > div {
36
+ border: 2px dotted gray;
37
+ }
34
38
  .tab-raw {
35
39
  display: none;
36
40
  }
@@ -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],
@@ -23,7 +23,7 @@ class WcoEmail::ApiController < ActionController::Base
23
23
 
24
24
  def check_credentials
25
25
  if params[:secret] != AWS_SES_LAMBDA_SECRET
26
- render status: 400, json: { status: 400 }
26
+ render status: 400, json: { status: 400, message: "#check_credentials says unauthorized." }
27
27
  return
28
28
  end
29
29
  end
@@ -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
+ ## Nothing should be here.
13
+ def set_lists
14
+ end
15
15
 
16
16
  end
@@ -78,7 +78,7 @@ class WcoEmail::ContextsController < WcoEmail::ApplicationController
78
78
  authorize! :new, WcoEmail::Context
79
79
  @tmpl = @email_template = WcoEmail::EmailTemplate.where( slug: params[:template_slug] ).first ||
80
80
  WcoEmail::EmailTemplate.where( id: params[:template_slug] ).first ||
81
- WcoEmail::EmailTemplate.new
81
+ WcoEmail::EmailTemplate.where({ slug: 'blank' }).last
82
82
  attrs = {}
83
83
  if @tmpl
84
84
  attrs = @tmpl.attributes.slice( :subject, :body, :from_email )
@@ -146,10 +146,9 @@ class WcoEmail::ContextsController < WcoEmail::ApplicationController
146
146
  private
147
147
 
148
148
  def set_lists
149
- super
150
149
  @email_layouts_list = WcoEmail::EmailTemplate::LAYOUTS
151
150
  @email_templates_list = [ [nil, nil] ] + WcoEmail::EmailTemplate.all.map { |tmpl| [ tmpl.slug, tmpl.id ] }
152
- @leads_list = Wco::Lead.list
151
+ @leads_list = Wco::Lead.list
153
152
  end
154
153
 
155
154
  end
@@ -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
@@ -2,8 +2,6 @@
2
2
 
3
3
  class WcoEmail::EmailTemplatesController < WcoEmail::ApplicationController
4
4
 
5
- # before_action :set_lists, only: %i| new |
6
-
7
5
  def create
8
6
  authorize! :create, WcoEmail::EmailTemplate
9
7
  @template = WcoEmail::EmailTemplate.create params[:template].permit!
@@ -8,11 +8,8 @@ require 'sidekiq'
8
8
  ## 2023-03-07 _vp_ Continue
9
9
  ## 2023-12-28 _vp_ Continue
10
10
  ##
11
- ## class_name EIJ
12
- ##
13
11
  class WcoEmail::MessageIntakeJob
14
12
  include Sidekiq::Job
15
- # include Sidekiq::Util
16
13
 
17
14
  sidekiq_options queue: 'wco_email_rb'
18
15
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  = javascript_include_tag "//code.jquery.com/jquery-3.3.1.min.js"
11
11
 
12
- %script{ :src => "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" }
12
+ = javascript_include_tag "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"
13
13
  = stylesheet_link_tag "//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
14
14
 
15
15
  = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
@@ -1,30 +1,23 @@
1
1
 
2
- -# = ctx.inspect
2
+ -# - blank_tmpl_id = WcoEmail::EmailTemplate.where({ slug: 'blank' }).first&.id
3
3
 
4
4
  .email-contexts--form
5
- -# - url = ctx.new_record? ? contexts_path : context_path(ctx)
6
5
  = form_for ctx, as: :context do |f|
7
6
 
8
7
  .flex-row
9
- = f.label "Template"
10
- = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || ctx.email_template_id ), {}, { class: 'select2' }
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 ), {}, { class: 'select2', required: true }
11
10
  - if ctx.email_template_id
12
11
  = link_to '[view]', email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
13
12
  = link_to '[~]', edit_email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
14
13
  <b>Layout:</b>
15
14
  = ctx.email_template.layout
16
15
 
17
- -# .field
18
- -# %label Layout
19
- -# = f.select :layout, options_for_select( @layouts_list, selected: ctx.layout_id )
20
-
21
16
  .flex-row
22
17
  %label From
23
18
  = f.select :from_email, options_for_select(WcoEmail::EmailTemplate.from_emails_list, selected: ctx.from_email), {}, { class: 'select2' }
24
-
25
19
  %label To lead
26
20
  = f.select :lead_id, options_for_select( @leads_list, selected: ctx.lead_id ), {}, { class: 'select2' }
27
-
28
21
  %label cc
29
22
  = f.text_field :cc, class: 'w-100'
30
23
 
@@ -36,6 +29,7 @@
36
29
  = f.label :reply_to_message
37
30
  = 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
31
 
32
+
39
33
  .tab-labels.flex-row
40
34
  %a.label-raw{ href: "javascript: void(0)", data: { ref: '.tab-raw' } } Raw
41
35
  %a.label-preview.active{ href: "javascript: void(0)", data: { ref: '.tab-preview' } } Preview
@@ -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
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.8
4
+ version: 0.1.1.10
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-01-11 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -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
@@ -448,9 +446,9 @@ files:
448
446
  - app/views/wco_email/sessions/new.html.erb
449
447
  - app/views/wco_email/unsubscribes/_header.haml
450
448
  - app/views/wco_email/unsubscribes/_table.haml
451
- - config/credentials.yml.enc
452
449
  - config/initializers/assets.rb
453
450
  - config/routes.rb
451
+ - config/trash/credentials.yml.enc
454
452
  - lib/systemd/system/wco_email_sidekiq.service
455
453
  - lib/tasks/bjjcollective/sitemap.rb
456
454
  - lib/tasks/db_tasks.rake
@@ -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?