ish_manager 0.1.8.468 → 0.1.8.470

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/ish_manager/application.scss +9 -2
  3. data/app/controllers/ish_manager/application_controller.rb +1 -3
  4. data/app/controllers/ish_manager/email_conversations_controller.rb +9 -1
  5. data/app/controllers/ish_manager/email_templates_controller.rb +18 -2
  6. data/app/controllers/ish_manager/lead_action_templates_controller.rb +27 -0
  7. data/app/controllers/ish_manager/lead_actions_controller.rb +10 -0
  8. data/app/controllers/ish_manager/newsitems_controller.rb +18 -5
  9. data/app/controllers/ish_manager/user_profiles_controller.rb +4 -4
  10. data/app/helpers/ish_manager/application_helper.rb +14 -0
  11. data/app/mailers/ish_manager/application_mailer.rb +1 -1
  12. data/app/mailers/ish_manager/office_mailer.rb +14 -9
  13. data/app/views/ish_manager/application/_main_header_admin.haml +7 -4
  14. data/app/views/ish_manager/application/home.haml +85 -5
  15. data/app/views/ish_manager/email_campaigns/_form.haml +1 -1
  16. data/app/views/ish_manager/email_contexts/_form.haml +1 -1
  17. data/app/views/ish_manager/email_layouts/can_unsubscribe.html.erb +0 -0
  18. data/app/views/ish_manager/email_layouts/piousbox_roundborders.html.erb +0 -0
  19. data/app/views/ish_manager/email_layouts/plain.html.erb +0 -0
  20. data/app/views/ish_manager/email_layouts/roundborders.html.erb +0 -0
  21. data/app/views/ish_manager/email_layouts/wco_roundborders.html.erb +0 -0
  22. data/app/views/ish_manager/email_templates/_footer_unsubscribe.html.erb +26 -0
  23. data/app/views/ish_manager/email_templates/_form.haml +11 -1
  24. data/app/views/ish_manager/email_templates/_index.haml +1 -0
  25. data/app/views/ish_manager/email_templates/_m20221201react.html.erb +2 -2
  26. data/app/views/ish_manager/email_templates/_m202309_feedback.html.erb +1153 -0
  27. data/app/views/ish_manager/email_templates/_m202309_holiday_black_friday.html.erb +0 -0
  28. data/app/views/ish_manager/email_templates/_m202309_holiday_christmas.html.erb +0 -0
  29. data/app/views/ish_manager/email_templates/_m202309_holiday_cinco_de_mayo.html.erb +0 -0
  30. data/app/views/ish_manager/email_templates/_m202309_holiday_columbus_day.html.erb +0 -0
  31. data/app/views/ish_manager/email_templates/_m202309_holiday_cyber_monday.html.erb +0 -0
  32. data/app/views/ish_manager/email_templates/_m202309_holiday_easter.html.erb +0 -0
  33. data/app/views/ish_manager/email_templates/_m202309_holiday_fathers_day.html.erb +0 -0
  34. data/app/views/ish_manager/email_templates/_m202309_holiday_flag_day.html.erb +0 -0
  35. data/app/views/ish_manager/email_templates/_m202309_holiday_groundhog_day.html.erb +0 -0
  36. data/app/views/ish_manager/email_templates/_m202309_holiday_halloween.html.erb +0 -0
  37. data/app/views/ish_manager/email_templates/_m202309_holiday_inauguration_day.html.erb +0 -0
  38. data/app/views/ish_manager/email_templates/_m202309_holiday_independence_day.html.erb +0 -0
  39. data/app/views/ish_manager/email_templates/_m202309_holiday_juneteenth.html.erb +0 -0
  40. data/app/views/ish_manager/email_templates/_m202309_holiday_labor_day.html.erb +0 -0
  41. data/app/views/ish_manager/email_templates/_m202309_holiday_may_forth.html.erb +3 -0
  42. data/app/views/ish_manager/email_templates/_m202309_holiday_memorial_day.html.erb +0 -0
  43. data/app/views/ish_manager/email_templates/_m202309_holiday_mlk.html.erb +0 -0
  44. data/app/views/ish_manager/email_templates/_m202309_holiday_mothers_day.html.erb +0 -0
  45. data/app/views/ish_manager/email_templates/_m202309_holiday_newyear.html.erb +0 -0
  46. data/app/views/ish_manager/email_templates/_m202309_holiday_presidents_day.html.erb +0 -0
  47. data/app/views/ish_manager/email_templates/_m202309_holiday_st_patricks.html.erb +0 -0
  48. data/app/views/ish_manager/email_templates/_m202309_holiday_thanksgiving.html.erb +0 -0
  49. data/app/views/ish_manager/email_templates/_m202309_holiday_valentines.html.erb +0 -0
  50. data/app/views/ish_manager/email_templates/_m202309_holiday_veterans_day.html.erb +0 -0
  51. data/app/views/ish_manager/email_templates/_m202309_ror4.html.erb +985 -0
  52. data/app/views/ish_manager/email_templates/_marketing_node_1.html.erb +764 -456
  53. data/app/views/ish_manager/email_templates/edit.haml +3 -0
  54. data/app/views/ish_manager/lead_action_templates/_form.haml +12 -0
  55. data/app/views/ish_manager/lead_action_templates/edit.haml +5 -0
  56. data/app/views/ish_manager/lead_action_templates/index.haml +11 -0
  57. data/app/views/ish_manager/lead_actions/index.haml +12 -0
  58. data/config/routes.rb +12 -0
  59. data/lib/ish_manager.rb +0 -2
  60. data/lib/tasks/office_tasks.rake +15 -5
  61. metadata +40 -5
  62. data/app/controllers/ish_manager/email_unsubscribes_controller.rb +0 -17
  63. data/app/views/ish_manager/email_templates/done/_form.haml +0 -22
  64. data/app/views/ish_manager/email_templates/done/_form2.haml +0 -26
@@ -1,3 +1,6 @@
1
1
 
2
2
  .email-templates-edit.max-width
3
+ %h5
4
+ Edit
5
+ = link_to @email_template.slug, email_template_path( @email_template )
3
6
  = render 'form', email_template: @email_template
@@ -0,0 +1,12 @@
1
+
2
+ - url = tmpl.new_record? ? lead_action_templates_path : lead_action_template_path( tmpl )
3
+ .lead-action-templates--form
4
+ = form_for tmpl, url: url, as: :tmpl do |f|
5
+ .field
6
+ %label slug
7
+ = f.text_field :slug
8
+ .field
9
+ %label Action exe
10
+ = f.text_area :action_exe
11
+ .actions
12
+ = f.submit 'Submit'
@@ -0,0 +1,5 @@
1
+
2
+ .lead-action-templates-edit.maxwidth
3
+ %h5 Edit Lead Action Template
4
+
5
+ = render 'form', tmpl: @tmpl
@@ -0,0 +1,11 @@
1
+
2
+ .lead-action-templates-index.maxwidth
3
+ %h5 Lead Action Templates
4
+
5
+ %ul
6
+ - @tmpls.each do |tmpl|
7
+ %li
8
+ = link_to "[~ #{tmpl.slug}]", edit_lead_action_template_path( tmpl )
9
+
10
+ %hr
11
+ = render 'form', tmpl: @new_lat
@@ -0,0 +1,12 @@
1
+
2
+ .lead-actions-index.maxwidth
3
+ %h5 Lead Actions
4
+
5
+ %ul
6
+ - @lead_actions.each do |la|
7
+ %li
8
+ %ul
9
+ - JSON.parse( la.params ).each do |k, v|
10
+ %li
11
+ = k
12
+ = v
data/config/routes.rb CHANGED
@@ -105,6 +105,8 @@ IshManager::Engine.routes.draw do
105
105
 
106
106
  resources :email_unsubscribes
107
107
 
108
+ ## L
109
+ resources :lead_actions
108
110
  resources :lead_leadsets
109
111
 
110
112
  get 'leads', :to => 'leads#index'
@@ -116,13 +118,23 @@ IshManager::Engine.routes.draw do
116
118
 
117
119
  resources :leadset_tags
118
120
 
121
+ resources :lead_actions
122
+ resources :lead_action_templates
123
+
124
+ ## M
119
125
 
120
126
  resources :meetings
121
127
 
128
+ ## N
129
+
122
130
  resources :newsitems
123
131
 
132
+ ## O
133
+
124
134
  resources :office_actions
125
135
 
136
+ ## P
137
+
126
138
  resources :photos
127
139
  resources :payments
128
140
  resources :prices
data/lib/ish_manager.rb CHANGED
@@ -7,8 +7,6 @@ require 'kaminari/actionview'
7
7
  require 'mongoid_paperclip'
8
8
 
9
9
  module IshManager
10
- # Your code goes here...
11
-
12
10
  module Gameui
13
11
  end
14
12
  end
@@ -5,6 +5,7 @@ namespace :office do
5
5
  task schs: :environment do
6
6
  while true do
7
7
 
8
+ ## Office::ScheduledEmailAction
8
9
  Sch.active.where({ :perform_at.lte => Time.now }).each do |sch|
9
10
 
10
11
  sch.send_and_roll
@@ -24,11 +25,7 @@ namespace :office do
24
25
 
25
26
  ## send and roll
26
27
  Office::Action.active.where({ :perform_at.lte => Time.now }).each do |oact|
27
-
28
- oact.update({
29
- perform_at: nil,
30
- # state: OAct::STATE_INACTIVE, ## @TODO: remove, they remain active but non-perform.
31
- })
28
+ oact.update({ perform_at: nil })
32
29
  eval( oact.action_exe )
33
30
  oact.ties.each do |tie|
34
31
  next_oact = tie.next_office_action
@@ -53,6 +50,18 @@ namespace :office do
53
50
 
54
51
  ctxs = ::Ish::EmailContext.scheduled.notsent
55
52
  ctxs.map do |ctx|
53
+
54
+ unsub = Ish::EmailUnsubscribe.where({ lead_id: ctx.lead_id, template_id: ctx.template_id }).first
55
+ if unsub
56
+ Office::AdminMessage.create({ message: "Lead `#{ctx.lead.full_name}` [mailto:#{ctx.lead.email}] has already unsubscribed from template `#{Ish::EmailTemplate.find( ctx.template_id ).slug}` ." })
57
+ email_action_ids = EAction.where({ email_template_id: ctx.template_id }).map(&:id)
58
+ schs = Sch.active.where({
59
+ lead_id: ctx.lead_id,
60
+ :email_action_id.in => email_action_ids,
61
+ })
62
+ schs.update({ state: Office::ScheduledEmailAction::STATE_UNSUBSCRIBED })
63
+ end
64
+
56
65
  out = IshManager::OfficeMailer.send_context_email( ctx[:id].to_s )
57
66
  Rails.env.production? ? out.deliver_later : out.deliver_now
58
67
  print '^'
@@ -61,6 +70,7 @@ namespace :office do
61
70
  duration = Rails.env.production? ? 120 : 15 # 2 minutes or 15 seconds
62
71
  sleep duration
63
72
  print '.'
73
+
64
74
  end
65
75
  end
66
76
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.468
4
+ version: 0.1.8.470
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -492,7 +492,6 @@ files:
492
492
  - app/controllers/ish_manager/email_filters_controller.rb
493
493
  - app/controllers/ish_manager/email_messages_controller.rb
494
494
  - app/controllers/ish_manager/email_templates_controller.rb
495
- - app/controllers/ish_manager/email_unsubscribes_controller.rb
496
495
  - app/controllers/ish_manager/events_controller.rb
497
496
  - app/controllers/ish_manager/galleries_controller.rb
498
497
  - app/controllers/ish_manager/image_assets_controller.rb
@@ -502,6 +501,8 @@ files:
502
501
  - app/controllers/ish_manager/iro_purses_controller.rb
503
502
  - app/controllers/ish_manager/iro_strategies_controller.rb
504
503
  - app/controllers/ish_manager/iro_watches_controller.rb
504
+ - app/controllers/ish_manager/lead_action_templates_controller.rb
505
+ - app/controllers/ish_manager/lead_actions_controller.rb
505
506
  - app/controllers/ish_manager/leads_controller.rb
506
507
  - app/controllers/ish_manager/leadset_tags_controller.rb
507
508
  - app/controllers/ish_manager/leadsets_controller.rb
@@ -620,6 +621,11 @@ files:
620
621
  - app/views/ish_manager/email_filters/edit.haml
621
622
  - app/views/ish_manager/email_filters/index.haml
622
623
  - app/views/ish_manager/email_filters/new.haml
624
+ - app/views/ish_manager/email_layouts/can_unsubscribe.html.erb
625
+ - app/views/ish_manager/email_layouts/piousbox_roundborders.html.erb
626
+ - app/views/ish_manager/email_layouts/plain.html.erb
627
+ - app/views/ish_manager/email_layouts/roundborders.html.erb
628
+ - app/views/ish_manager/email_layouts/wco_roundborders.html.erb
623
629
  - app/views/ish_manager/email_messages/_show_iframe.haml
624
630
  - app/views/ish_manager/email_messages/index.haml
625
631
  - app/views/ish_manager/email_messages/show.haml
@@ -627,6 +633,7 @@ files:
627
633
  - app/views/ish_manager/email_messages/show_source.haml
628
634
  - app/views/ish_manager/email_messages/show_stripped.haml
629
635
  - app/views/ish_manager/email_templates/_acknowledgement_of_document_receipt.html.erb
636
+ - app/views/ish_manager/email_templates/_footer_unsubscribe.html.erb
630
637
  - app/views/ish_manager/email_templates/_form.haml
631
638
  - app/views/ish_manager/email_templates/_form_mini.haml
632
639
  - app/views/ish_manager/email_templates/_form_reply_mini.haml
@@ -634,6 +641,32 @@ files:
634
641
  - app/views/ish_manager/email_templates/_index.haml
635
642
  - app/views/ish_manager/email_templates/_m20221201react.html.erb
636
643
  - app/views/ish_manager/email_templates/_m20221222merryxmas.html.erb
644
+ - app/views/ish_manager/email_templates/_m202309_feedback.html.erb
645
+ - app/views/ish_manager/email_templates/_m202309_holiday_black_friday.html.erb
646
+ - app/views/ish_manager/email_templates/_m202309_holiday_christmas.html.erb
647
+ - app/views/ish_manager/email_templates/_m202309_holiday_cinco_de_mayo.html.erb
648
+ - app/views/ish_manager/email_templates/_m202309_holiday_columbus_day.html.erb
649
+ - app/views/ish_manager/email_templates/_m202309_holiday_cyber_monday.html.erb
650
+ - app/views/ish_manager/email_templates/_m202309_holiday_easter.html.erb
651
+ - app/views/ish_manager/email_templates/_m202309_holiday_fathers_day.html.erb
652
+ - app/views/ish_manager/email_templates/_m202309_holiday_flag_day.html.erb
653
+ - app/views/ish_manager/email_templates/_m202309_holiday_groundhog_day.html.erb
654
+ - app/views/ish_manager/email_templates/_m202309_holiday_halloween.html.erb
655
+ - app/views/ish_manager/email_templates/_m202309_holiday_inauguration_day.html.erb
656
+ - app/views/ish_manager/email_templates/_m202309_holiday_independence_day.html.erb
657
+ - app/views/ish_manager/email_templates/_m202309_holiday_juneteenth.html.erb
658
+ - app/views/ish_manager/email_templates/_m202309_holiday_labor_day.html.erb
659
+ - app/views/ish_manager/email_templates/_m202309_holiday_may_forth.html.erb
660
+ - app/views/ish_manager/email_templates/_m202309_holiday_memorial_day.html.erb
661
+ - app/views/ish_manager/email_templates/_m202309_holiday_mlk.html.erb
662
+ - app/views/ish_manager/email_templates/_m202309_holiday_mothers_day.html.erb
663
+ - app/views/ish_manager/email_templates/_m202309_holiday_newyear.html.erb
664
+ - app/views/ish_manager/email_templates/_m202309_holiday_presidents_day.html.erb
665
+ - app/views/ish_manager/email_templates/_m202309_holiday_st_patricks.html.erb
666
+ - app/views/ish_manager/email_templates/_m202309_holiday_thanksgiving.html.erb
667
+ - app/views/ish_manager/email_templates/_m202309_holiday_valentines.html.erb
668
+ - app/views/ish_manager/email_templates/_m202309_holiday_veterans_day.html.erb
669
+ - app/views/ish_manager/email_templates/_m202309_ror4.html.erb
637
670
  - app/views/ish_manager/email_templates/_marketing_node_1.html.erb
638
671
  - app/views/ish_manager/email_templates/_marketing_react_1.html
639
672
  - app/views/ish_manager/email_templates/_marketing_react_2.html.erb
@@ -656,8 +689,6 @@ files:
656
689
  - app/views/ish_manager/email_templates/_tracking_footer.html.erb
657
690
  - app/views/ish_manager/email_templates/_wasyaco_roundborders.html.erb
658
691
  - app/views/ish_manager/email_templates/_wasyaco_social.html.erb
659
- - app/views/ish_manager/email_templates/done/_form.haml
660
- - app/views/ish_manager/email_templates/done/_form2.haml
661
692
  - app/views/ish_manager/email_templates/edit.haml
662
693
  - app/views/ish_manager/email_templates/iframe_src.haml
663
694
  - app/views/ish_manager/email_templates/index.haml
@@ -721,6 +752,10 @@ files:
721
752
  - app/views/ish_manager/kaminari/_page.html.erb
722
753
  - app/views/ish_manager/kaminari/_paginator.html.erb
723
754
  - app/views/ish_manager/kaminari/_prev_page.html.erb
755
+ - app/views/ish_manager/lead_action_templates/_form.haml
756
+ - app/views/ish_manager/lead_action_templates/edit.haml
757
+ - app/views/ish_manager/lead_action_templates/index.haml
758
+ - app/views/ish_manager/lead_actions/index.haml
724
759
  - app/views/ish_manager/leads/_form.haml
725
760
  - app/views/ish_manager/leads/_form_import.haml
726
761
  - app/views/ish_manager/leads/_index.haml
@@ -1,17 +0,0 @@
1
-
2
- class ::IshManager::EmailUnsubscribesController < IshManager::ApplicationController
3
-
4
- layout false
5
-
6
- # alphabetized : )
7
-
8
- def new
9
- @unsubscribe = Ish::Unsubscribe.new
10
- authorize! :new, @unsubscribe
11
- end
12
-
13
- def create
14
- authorize! :open_permission, IshManager::Ability
15
- end
16
-
17
- end
@@ -1,22 +0,0 @@
1
-
2
- - url = %w| index new create |.include?( params[:action] ) ? email_templates_path : email_template_path(email_template.id)
3
-
4
- .email-templates--form
5
- = form_for email_template, url: url do |f|
6
- .field
7
- = f.label :type
8
- = f.select :type, options_for_select(Ish::EmailTemplate.type_list, selected: email_template.type)
9
- .field
10
- = f.label :slug
11
- = f.text_field :slug
12
- .field
13
- = f.label :from_email
14
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
15
- .field.field-subject
16
- = f.label :subject
17
- = f.text_field :subject
18
- .field
19
- = f.label :body
20
- = f.text_area :body, class: 'tinymce'
21
- .actions
22
- = f.submit 'Submit'
@@ -1,26 +0,0 @@
1
-
2
- - url = email_template.new_record? ? email_templates_path : email_template_path(email_template.id)
3
-
4
- .email-templates--form
5
- = form_for email_template, url: url do |f|
6
- .row
7
- .col-md-4
8
- .field
9
- = f.label :slug
10
- = f.text_field :slug
11
- .col-md-4
12
- .field
13
- = f.label :layout
14
- = f.select :layout, options_for_select(Ish::EmailTemplate::LAYOUTS, selected: email_template.layout)
15
- .col-md-4
16
- .field
17
- = f.label "From"
18
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
19
- .field.field-subject
20
- = f.label :subject
21
- = f.text_field :subject
22
- .field
23
- -# = f.label :body
24
- = f.text_area :body, class: 'tinymce'
25
- .actions
26
- = f.submit 'Submit'