ish_manager 0.1.8.413 → 0.1.8.415

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/ish_manager/application.scss +1 -1
  3. data/app/assets/stylesheets/ish_manager/email.scss +11 -0
  4. data/app/controllers/ish_manager/application_controller.rb +1 -0
  5. data/app/controllers/ish_manager/email_actions_controller.rb +1 -1
  6. data/app/controllers/ish_manager/email_campaigns_controller.rb +1 -12
  7. data/app/controllers/ish_manager/email_templates_controller.rb +19 -1
  8. data/app/controllers/ish_manager/office_actions_controller.rb +85 -0
  9. data/app/mailers/ish_manager/office_mailer.rb +8 -0
  10. data/app/views/ish_manager/application/_main_header_admin.haml +10 -7
  11. data/app/views/ish_manager/email_actions/_form.haml +3 -3
  12. data/app/views/ish_manager/email_actions/index.haml +9 -9
  13. data/app/views/ish_manager/email_campaigns/_form.haml +1 -1
  14. data/app/views/ish_manager/email_campaigns/index.haml +5 -2
  15. data/app/views/ish_manager/email_templates/_form.haml +2 -2
  16. data/app/views/ish_manager/email_templates/_marketing_react_2.html.erb +749 -0
  17. data/app/views/ish_manager/email_templates/show.haml +3 -3
  18. data/app/views/ish_manager/office_actions/_form.haml +49 -0
  19. data/app/views/ish_manager/office_actions/edit.haml +7 -0
  20. data/app/views/ish_manager/office_actions/index.haml +38 -0
  21. data/app/views/ish_manager/office_actions/new.haml +9 -0
  22. data/app/views/ish_manager/office_actions/show.haml +11 -0
  23. data/app/views/ish_manager/scheduled_email_actions/index.haml +5 -6
  24. data/config/routes.rb +2 -0
  25. data/lib/tasks/office_tasks.rake +30 -1
  26. metadata +8 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac60f7cd88786021285d1497b25f91540c45f639d1912ef070eb3329f2e1f15e
4
- data.tar.gz: 21a8968131ae5f0075c774f3ad27cfdc0fe9d2927c0150f8c3d28f3366e03ef1
3
+ metadata.gz: 613aa0218db8158e91ee2892cc31c54a8d39d97cd9f9515eaf8fd432d898c62a
4
+ data.tar.gz: 1b35c0e649fbf0cbc8e6a1884bef677ee6d89565bae9832facb313c89659e49f
5
5
  SHA512:
6
- metadata.gz: 7b4ea92b7f2208a3c80a2a4d478e29582ea2fd5aa37b99afdae807b6b8003f6fc21e0afef66d4ffb72195e25e4993e5ad2a7311b5be1ac2f6e5fa540235aadb6
7
- data.tar.gz: 5195f3b41ac7dd1568878ef9ec5de62dbfde500ca3844ffe75e0f211b3f5433c724d1a9ead3578fd7508e4e3f71037513d9bea3945085539dd6d246b7a4ed0ad
6
+ metadata.gz: 488a0e826ecc70bb707c8fa021645871387c9d21c5f7560dd077d3fba9c48317186c3b27be923f45f25cbbcfd65d9d0cec8f9da51bc93bcb3a5c8d6eef0b1893
7
+ data.tar.gz: 8329b75417ae55e85be51d38e69721dd7c8f72c2b1a2d7f661015c2bb5a95868fa793cbb2c84833ae6dd3f4d00b633430b04c1c291ad893614197170052ba977
@@ -359,7 +359,7 @@ textarea.large {
359
359
  flex-wrap: wrap;
360
360
 
361
361
  li {
362
- margin: 0 0 10px 0;
362
+ margin: 0 10px 10px 0;
363
363
  display: inline-block;
364
364
  min-width: 220px;
365
365
 
@@ -53,3 +53,14 @@
53
53
  }
54
54
  }
55
55
 
56
+ .scheduled-emails-index {
57
+ .items {
58
+ display: flex;
59
+ flex-wrap: wrap;
60
+
61
+ .Card {
62
+ margin: 0 10px 10px 0;
63
+ padding: 10px;
64
+ }
65
+ }
66
+ }
@@ -81,6 +81,7 @@ class IshManager::ApplicationController < ActionController::Base
81
81
  @leadsets_list = Leadset.list
82
82
  @locations_list = ::Gameui::Map.list
83
83
  @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
84
+ @office_actions_list = [[nil,nil]] + Office::Action.all.map { |a| [ a.slug, a.id ] }
84
85
  @profiles_list = Ish::UserProfile.list
85
86
  @reports_list = Report.all.list
86
87
  @user_profiles_list = Ish::UserProfile.list
@@ -42,7 +42,7 @@ class ::IshManager::EmailActionsController < IshManager::ApplicationController
42
42
  params[:email_action][:ties_attributes].delete( k )
43
43
  end
44
44
  if v[:to_delete] == "1"
45
- Actie.find( v[:id] ).delete
45
+ EActie.find( v[:id] ).delete
46
46
  params[:email_action][:ties_attributes].delete( k )
47
47
  end
48
48
  end
@@ -27,18 +27,7 @@ class ::IshManager::EmailCampaignsController < IshManager::ApplicationController
27
27
  def do_send
28
28
  @campaign = Ish::EmailCampaign.find params[:id]
29
29
  authorize! :send, @campaign
30
- @campaign.leads.each do |lead|
31
- tmpl = @campaign.email_template
32
-
33
- ctx = Ctx.create!({
34
- email_template: tmpl,
35
- send_at: Time.now,
36
- lead_id: lead.id,
37
- from_email: tmpl.from_email,
38
- subject: tmpl.subject,
39
- })
40
- end
41
-
30
+ @campaign.do_send
42
31
  end
43
32
 
44
33
  def show
@@ -33,8 +33,26 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
33
33
  def iframe_src
34
34
  @tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
35
35
  Ish::EmailTemplate.find_by({ slug: params[:id] })
36
- @ctx = Ctx.new({ email_template: @tmpl })
37
36
  authorize! :iframe_src, @email_template
37
+
38
+ @ctx = Ctx.new({ email_template: @tmpl, lead_id: 999 })
39
+
40
+ @utm_tracking_str = {
41
+ # 'v' => 1,
42
+ # 'tid' => 'UA-53077236-2',
43
+ 'cid' => @ctx.lead_id,
44
+ # 'uid' => @ctx.lead_id,
45
+ # 't' => 'event',
46
+ # 'ec' => 'email',
47
+ # 'ea' => 'open',
48
+ # 'cn' => @campaign.slug,
49
+ # 'ci' => @campaign.slug,
50
+ # 'cm' => 'email',
51
+ # 'utm_source' => @campaign.slug,
52
+ 'utm_medium' => 'email',
53
+ 'utm_campaign' => 'campaign-1', # @campaign.slug,
54
+ }.map { |k, v| "#{k}=#{v}" }.join("&")
55
+
38
56
  render layout: false
39
57
  end
40
58
 
@@ -0,0 +1,85 @@
1
+
2
+ class ::IshManager::OfficeActionsController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ ## Alphabetized : )
7
+
8
+ def create
9
+ @new_office_action = Office::Action.new params[:office_action].permit!
10
+ authorize! :create, @new_office_action
11
+ flag = @new_office_action.save
12
+ if flag
13
+ flash[:notice] = "Created OAction."
14
+ redirect_to action: 'index'
15
+ else
16
+ flash[:alert] = "Cannot create OAction: #{@new_office_action.errors.full_messages.join(', ')}."
17
+ render action: 'new'
18
+ end
19
+ end
20
+
21
+ def edit
22
+ @act = @office_action = Office::Action.find( params[:id] )
23
+ @act.ties.push Office::ActionTie.new( next_office_action_id: nil )
24
+ authorize! :edit, @act
25
+ end
26
+
27
+ def index
28
+ @office_actions = Office::Action.all
29
+
30
+ authorize! :index, @new_office_action
31
+ end
32
+
33
+ def new
34
+ authorize! :new, @new_office_action
35
+ end
36
+
37
+ def show
38
+ @act = @office_action = Office::Action.find( params[:id] )
39
+ authorize! :show, @act
40
+ end
41
+
42
+ ## def create; update; end
43
+ ## def upsert; update; end
44
+ def update
45
+ if params[:id]
46
+ @act = @office_action = Office::Action.find( params[:id] )
47
+ else
48
+ @act = @office_action = Office::Action.new
49
+ end
50
+ authorize! :upsert, @act
51
+
52
+ if params[:office_action][:ties_attributes]
53
+ params[:office_action][:ties_attributes].each do |k, v|
54
+ if !v[:next_office_action_id].present?
55
+ params[:office_action][:ties_attributes].delete( k )
56
+ end
57
+ if v[:to_delete] == "1"
58
+ EActie.find( v[:id] ).delete
59
+ params[:office_action][:ties_attributes].delete( k )
60
+ end
61
+ end
62
+ end
63
+
64
+ flag = @act.update_attributes( params[:office_action].permit! )
65
+ if flag
66
+ flash[:notice] = 'Success'
67
+ redirect_to action: 'index'
68
+ else
69
+ flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}. #{@act.ties.map { |t| t.errors.full_messages.join(', ') }.join(' | ') }"
70
+ render action: 'edit'
71
+ end
72
+
73
+ end
74
+
75
+ ##
76
+ ## private
77
+ ##
78
+ private
79
+
80
+ def set_lists
81
+ @new_office_action = Office::Action.new
82
+ super
83
+ end
84
+
85
+ end
@@ -57,8 +57,16 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
57
57
  ## 2023-04-02 _vp_ Continue.
58
58
  def send_context_email ctx_id
59
59
  @ctx = Ctx.find ctx_id
60
+
61
+ @utm_tracking_str = {
62
+ 'cid' => @ctx.lead_id,
63
+ 'utm_medium' => 'email',
64
+ 'utm_campaign' => @ctx.tmpl.slug,
65
+ }.map { |k, v| "#{k}=#{v}" }.join("&")
66
+
60
67
  ac = ActionController::Base.new
61
68
  ac.instance_variable_set( :@ctx, @ctx )
69
+ ac.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
62
70
 
63
71
  rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@ctx.tmpl.layout}")
64
72
  @ctx.update({
@@ -56,24 +56,24 @@
56
56
  = link_to "#{WpTag::INBOX} (#{Office::EmailConversation.in_emailtag(WpTag::INBOX).length})", email_conversations_in_path(WpTag::INBOX)
57
57
  = link_to '[+]', new_email_context_path
58
58
  %li
59
- = link_to "Templates (#{Ish::EmailTemplate.all.count})", email_templates_path
59
+ = link_to "Tmpls (#{Ish::EmailTemplate.all.count})", email_templates_path
60
60
  = link_to '[+]', new_email_template_path
61
61
  %li
62
- = link_to "Companies (#{Leadset.kept.length})", leadsets_path
62
+ = link_to "Co's (#{Leadset.kept.length})", leadsets_path
63
63
  = link_to '[+]', new_leadset_path
64
64
 
65
65
 
66
66
  %li
67
- = link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
67
+ = link_to "EActions (#{Office::EmailAction.count})", email_actions_path
68
68
  = link_to '[+]', new_email_action_path
69
69
  %ul
70
70
  %li
71
71
  = link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
72
72
  = link_to '[+]', new_email_filter_path
73
73
  %li
74
- = link_to "Contexts (#{Ctx.notsent.length})", notsent_email_contexts_path
74
+ = link_to "Ctxs (#{Ctx.notsent.length})", notsent_email_contexts_path
75
75
  = link_to '[+]', new_email_context_path
76
- = link_to 'summary', email_contexts_summary_path( format: :csv )
76
+ = link_to '[csv]', email_contexts_summary_path( format: :csv )
77
77
 
78
78
  %li
79
79
  = link_to "Leads (#{Lead.kept.length})", leads_path
@@ -81,13 +81,16 @@
81
81
  %li
82
82
  = link_to "Schs (#{Sch.active.length})", scheduled_email_actions_path
83
83
  = link_to '[+]', new_scheduled_email_action_path
84
+
84
85
  %ul
85
86
  %li &nbsp;
86
87
  %li &nbsp;
87
88
  %li
88
- = link_to 'Campaigns', email_campaigns_path
89
+ = link_to "Campaigns (#{Ish::EmailCampaign.count})", email_campaigns_path
89
90
  = link_to '[+]', new_email_campaign_path
90
- %li &nbsp;
91
+ %li
92
+ = link_to "OActions (#{Office::Action.count})", office_actions_path
93
+ = link_to '[+]', new_office_action_path
91
94
 
92
95
  .c
93
96
 
@@ -1,6 +1,6 @@
1
1
 
2
- - act = email_action
3
- - url = email_action.new_record? ? email_actions_path : email_action_path( email_action )
2
+ - eact = email_action
3
+ - url = email_action.new_record? ? email_actions_path : email_action_path( email_action )
4
4
 
5
5
  .email-actions--form
6
6
 
@@ -19,7 +19,7 @@
19
19
  -# = f.text_area :descr
20
20
  .field.flex-row
21
21
  %label Template
22
- = f.select :email_template_id, options_for_select( @email_templates_list, selected: act.email_template_id ), {}, class: 'select2'
22
+ = f.select :email_template_id, options_for_select( @email_templates_list, selected: eact.email_template_id ), {}, class: 'select2'
23
23
 
24
24
  .col-md-6
25
25
  .field
@@ -11,22 +11,22 @@
11
11
  %th= check_box_tag 'abba'
12
12
  %th
13
13
  %th slug
14
- %th descr
15
14
  %th next actions
16
- - @email_actions.each do |act|
15
+ - @email_actions.each do |eact|
17
16
  %tr
18
17
  %td= check_box_tag 'abba'
19
- %td= link_to '[~]', edit_email_action_path( act )
20
- %td= link_to act.slug, email_action_path( act )
21
- %td= act.descr
22
- -# %td= act.lead&.email
18
+ %td= link_to '[~]', edit_email_action_path( eact )
19
+ %td
20
+ -# = link_to eact.slug, email_action_path( eact )
21
+ = eact.slug
22
+ .em.small= eact.descr
23
23
  %td
24
24
  %ul
25
- - act.ties.map do |next_a|
25
+ - eact.ties.map do |next_a|
26
26
  %li
27
27
  .a= next_a.next_at_exe
28
28
  .a
29
- - if next_a.next_email_action.slug == act.slug
29
+ - if next_a.next_email_action.slug == eact.slug
30
30
  (same)
31
31
  = next_a.next_email_action.slug
32
- -# %li= link_to next_a.next_email_action.slug, edit_email_action_path( next_a.next_email_action )
32
+
@@ -21,7 +21,7 @@
21
21
 
22
22
  .field
23
23
  = f.label "From"
24
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: campaign.from_email)
24
+ = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: campaign.from_email), {}, class: 'select2'
25
25
 
26
26
  .actions
27
27
  = f.submit 'Submit'
@@ -5,6 +5,9 @@
5
5
  Email Campaigns (#{@campaigns.length})
6
6
  = link_to '[+]', new_email_campaign_path
7
7
 
8
- - @campaigns.each do |c|
9
- = link_to c.slug, email_campaign_path(c)
8
+ %ul
9
+ - @campaigns.each do |c|
10
+ %li
11
+ = link_to c.slug, email_campaign_path(c)
12
+ = link_to '[~]', edit_email_campaign_path(c)
10
13
 
@@ -9,9 +9,9 @@
9
9
  = f.label :slug
10
10
  = f.text_field :slug
11
11
  .col-md-4
12
- .field
12
+ .flex-row
13
13
  = f.label :layout
14
- = f.select :layout, options_for_select(Ish::EmailTemplate::LAYOUTS, selected: email_template.layout)
14
+ = f.select :layout, options_for_select(Ish::EmailTemplate::LAYOUTS, selected: email_template.layout), {}, class: 'select2'
15
15
  .col-md-4
16
16
  .field
17
17
  = f.label "From"