ish_manager 0.1.8.385 → 0.1.8.387
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ish_manager/email_contexts.js +1 -15
- data/app/assets/javascripts/ish_manager/email_templates.js +1 -1
- data/app/assets/stylesheets/ish_manager/application.scss +2 -1
- data/app/assets/stylesheets/ish_manager/email.scss +2 -0
- data/app/assets/stylesheets/ish_manager/email_contexts.scss +0 -4
- data/app/assets/stylesheets/ish_manager/email_templates.scss +1 -1
- data/app/assets/stylesheets/ish_manager/{scheduled_actions_emails.scss → scheduled_email_actions.scss} +21 -4
- data/app/controllers/ish_manager/application_controller.rb +21 -17
- data/app/controllers/ish_manager/email_actions_controller.rb +20 -33
- data/app/controllers/ish_manager/email_contexts_controller.rb +10 -9
- data/app/jobs/ish_manager/test_email_job.rb +2 -0
- data/app/mailers/ish_manager/application_mailer.rb +4 -0
- data/app/mailers/ish_manager/office_mailer.rb +5 -15
- data/app/views/ish_manager/application_mailer/test_email.html.erb +3 -0
- data/app/views/ish_manager/email_actions/_form.haml +4 -4
- data/app/views/ish_manager/email_actions/new.haml +2 -0
- data/app/views/ish_manager/email_actions/show.haml +9 -1
- data/app/views/ish_manager/email_contexts/_form.haml +17 -23
- data/app/views/ish_manager/email_contexts/edit.haml +3 -1
- data/app/views/ish_manager/email_contexts/iframe_src.haml +4 -0
- data/app/views/ish_manager/email_contexts/index.haml +0 -4
- data/app/views/ish_manager/email_contexts/new.haml +3 -1
- data/app/views/ish_manager/email_contexts/show.haml +7 -6
- data/app/views/ish_manager/email_conversations/show.haml +2 -1
- data/app/views/ish_manager/email_templates/_form.haml +3 -0
- data/app/views/ish_manager/email_templates/_plain.haml +4 -0
- data/app/views/ish_manager/email_templates/_wasyaco_roundborders.html.erb +3 -319
- data/app/views/ish_manager/email_templates/iframe_src.haml +1 -2
- data/app/views/ish_manager/scheduled_email_actions/_form.haml +9 -15
- data/app/views/ish_manager/scheduled_email_actions/_form_mini.haml-trash +28 -0
- data/app/views/ish_manager/scheduled_email_actions/index.haml +3 -1
- data/config/routes.rb +1 -0
- data/lib/tasks/office_tasks.rake +13 -12
- metadata +8 -5
- data/app/views/ish_manager/email_templates/plain.html.erb +0 -4
- /data/app/views/ish_manager/email_templates/{_plain.html.erb → plain.html.erb-trash} +0 -0
@@ -1,28 +1,22 @@
|
|
1
1
|
|
2
|
-
-#
|
3
|
-
-# scheduled_emails / _form
|
4
|
-
-#
|
5
|
-
|
6
2
|
- sch_a = scheduled_email_action
|
7
3
|
- url = sch_a.new_record? ? scheduled_email_actions_path : scheduled_email_action_path(sch_a.id)
|
8
4
|
|
9
5
|
.scheduled-email-actions--form
|
10
|
-
= form_for scheduled_email_action, url: url, as: :sch
|
6
|
+
= form_for scheduled_email_action, url: url, as: :sch do |f|
|
11
7
|
.header
|
12
8
|
%h5.title Schedule an email action
|
13
9
|
|
14
|
-
.
|
10
|
+
.flex-row
|
15
11
|
= f.label :lead
|
16
|
-
= f.select :lead_id, options_for_select(@leads_list, selected: sch_a[:lead_id]||params[:lead_id] ), class: 'select2'
|
17
|
-
.
|
12
|
+
= f.select :lead_id, options_for_select(@leads_list, selected: sch_a[:lead_id]||params[:lead_id] ), {}, class: 'select2'
|
13
|
+
.flex-row
|
18
14
|
%label State
|
19
|
-
= f.select :state, options_for_select(::Office::ScheduledEmailAction::STATES, selected: sch_a.state )
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
%br
|
25
|
-
.field
|
15
|
+
= f.select :state, options_for_select(::Office::ScheduledEmailAction::STATES, selected: sch_a.state )
|
16
|
+
.flex-row
|
17
|
+
= f.label :email_action
|
18
|
+
= f.select :email_action, options_for_select( @email_actions_list, selected: sch_a[:email_action_id] ), {}, class: 'select2'
|
19
|
+
.flex-row
|
26
20
|
= f.label :perform_at
|
27
21
|
= f.text_field :perform_at
|
28
22
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
-# unused, but maybe I should separate _form and _form_mini ?
|
3
|
+
|
4
|
+
- sch_a = scheduled_email_action
|
5
|
+
- url = sch_a.new_record? ? scheduled_email_actions_path : scheduled_email_action_path(sch_a.id)
|
6
|
+
|
7
|
+
.scheduled-email-actions--form
|
8
|
+
= form_for scheduled_email_action, url: url, as: :sch, html: { class: "form-mini" } do |f|
|
9
|
+
.header
|
10
|
+
%h5.title Schedule an email action
|
11
|
+
|
12
|
+
.flex-row
|
13
|
+
= f.label :lead
|
14
|
+
= f.select :lead_id, options_for_select(@leads_list, selected: sch_a[:lead_id]||params[:lead_id] ), {}, class: 'select2'
|
15
|
+
.field
|
16
|
+
%label State
|
17
|
+
= f.select :state, options_for_select(::Office::ScheduledEmailAction::STATES, selected: sch_a.state )
|
18
|
+
%br
|
19
|
+
.flex-row
|
20
|
+
= f.label :email_action
|
21
|
+
= f.select :email_action, options_for_select( @email_actions_list, selected: sch_a[:email_action_id] ), {}, class: 'select2'
|
22
|
+
%br
|
23
|
+
.field
|
24
|
+
= f.label :perform_at
|
25
|
+
= f.text_field :perform_at
|
26
|
+
|
27
|
+
.actions
|
28
|
+
= submit_tag 'Schedule'
|
@@ -6,6 +6,8 @@
|
|
6
6
|
-# (#{Sch.kept.count})
|
7
7
|
(#{Sch.all.count})
|
8
8
|
= link_to '[+]', new_scheduled_email_action_path
|
9
|
+
.header
|
10
|
+
Time now: #{Time.now.strftime('%Y-%m-%d %l:%M%P')}
|
9
11
|
|
10
12
|
.items
|
11
13
|
- @scheduled_email_actions.each do |sch|
|
@@ -19,4 +21,4 @@
|
|
19
21
|
%li <b>Tmpl:</b> #{sch.email_action.email_template.slug}
|
20
22
|
%li <b>Lead:</b> #{link_to sch.lead.email, lead_path(sch.lead) }
|
21
23
|
%li <b>State:</b> #{sch.state}
|
22
|
-
%li <b>Perform at:</b> #{sch.perform_at}
|
24
|
+
%li <b>Perform at:</b> #{sch.perform_at.in_time_zone}
|
data/config/routes.rb
CHANGED
data/lib/tasks/office_tasks.rake
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
namespace :office do
|
8
8
|
|
9
9
|
desc 'schheduled email actions, rolling perform'
|
10
|
-
task :
|
10
|
+
task schs: :environment do
|
11
11
|
while true do
|
12
12
|
|
13
13
|
Sch.active.where({ :perform_at.lte => Time.now }).each do |sch|
|
@@ -21,30 +21,31 @@ namespace :office do
|
|
21
21
|
})
|
22
22
|
ctx.save!
|
23
23
|
|
24
|
-
# schedule
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
# schedule next actions & update the action
|
25
|
+
sch.act.ties.each do |tie|
|
26
|
+
next_act = tie.next_email_action
|
27
|
+
next_at = eval(tie.next_at_exe)
|
28
|
+
next_sch = Sch.find_or_initialize_by({
|
28
29
|
lead_id: sch.lead_id,
|
29
|
-
email_action_id:
|
30
|
+
email_action_id: next_act.id,
|
30
31
|
})
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
next_sch.perform_at = next_at
|
33
|
+
next_sch.state = Sch::STATE_ACTIVE
|
34
|
+
next_sch.save!
|
34
35
|
end
|
35
36
|
|
36
|
-
print '
|
37
|
+
print '+'
|
37
38
|
|
38
39
|
end
|
39
40
|
|
40
41
|
# sleep 1.minute
|
41
42
|
sleep 10.seconds
|
42
|
-
print '
|
43
|
+
print '.'
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
46
47
|
desc "send emails"
|
47
|
-
task :
|
48
|
+
task email_worker: :environment do
|
48
49
|
while true do
|
49
50
|
|
50
51
|
ctxs = ::Ish::EmailContext.scheduled.unsent
|
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.
|
4
|
+
version: 0.1.8.387
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -298,7 +298,7 @@ files:
|
|
298
298
|
- app/assets/stylesheets/ish_manager/office.scss
|
299
299
|
- app/assets/stylesheets/ish_manager/pagination.scss
|
300
300
|
- app/assets/stylesheets/ish_manager/photos.scss
|
301
|
-
- app/assets/stylesheets/ish_manager/
|
301
|
+
- app/assets/stylesheets/ish_manager/scheduled_email_actions.scss
|
302
302
|
- app/assets/stylesheets/ish_manager/tags.scss
|
303
303
|
- app/assets/stylesheets/ish_manager/trash/bootstrap.css
|
304
304
|
- app/assets/stylesheets/ish_manager/trash/materialize.css
|
@@ -393,6 +393,7 @@ files:
|
|
393
393
|
- app/views/ish_manager/application/_search.haml
|
394
394
|
- app/views/ish_manager/application/home.haml
|
395
395
|
- app/views/ish_manager/application_mailer/shared_galleries.html.erb
|
396
|
+
- app/views/ish_manager/application_mailer/test_email.html.erb
|
396
397
|
- app/views/ish_manager/application_mailer/welcome.html.erb
|
397
398
|
- app/views/ish_manager/categories/_subtree.haml
|
398
399
|
- app/views/ish_manager/categories/index.haml
|
@@ -405,6 +406,7 @@ files:
|
|
405
406
|
- app/views/ish_manager/email_contexts/_form.haml
|
406
407
|
- app/views/ish_manager/email_contexts/_form_reply.haml
|
407
408
|
- app/views/ish_manager/email_contexts/edit.haml
|
409
|
+
- app/views/ish_manager/email_contexts/iframe_src.haml
|
408
410
|
- app/views/ish_manager/email_contexts/index.haml
|
409
411
|
- app/views/ish_manager/email_contexts/new.haml
|
410
412
|
- app/views/ish_manager/email_contexts/show.haml
|
@@ -434,7 +436,7 @@ files:
|
|
434
436
|
- app/views/ish_manager/email_templates/_marketing_wordpress_2.html
|
435
437
|
- app/views/ish_manager/email_templates/_piousbox_roundborders.html.erb
|
436
438
|
- app/views/ish_manager/email_templates/_piousbox_social.html.erb
|
437
|
-
- app/views/ish_manager/email_templates/_plain.
|
439
|
+
- app/views/ish_manager/email_templates/_plain.haml
|
438
440
|
- app/views/ish_manager/email_templates/_slug-1.html.erb
|
439
441
|
- app/views/ish_manager/email_templates/_slug-2.html.erb
|
440
442
|
- app/views/ish_manager/email_templates/_slug-3.html.erb
|
@@ -446,7 +448,7 @@ files:
|
|
446
448
|
- app/views/ish_manager/email_templates/iframe_src.haml
|
447
449
|
- app/views/ish_manager/email_templates/index.haml
|
448
450
|
- app/views/ish_manager/email_templates/new.haml
|
449
|
-
- app/views/ish_manager/email_templates/plain.html.erb
|
451
|
+
- app/views/ish_manager/email_templates/plain.html.erb-trash
|
450
452
|
- app/views/ish_manager/email_templates/show.haml
|
451
453
|
- app/views/ish_manager/email_unsubscribes/new.haml
|
452
454
|
- app/views/ish_manager/galleries/_form.haml
|
@@ -538,6 +540,7 @@ files:
|
|
538
540
|
- app/views/ish_manager/reports/show.haml
|
539
541
|
- app/views/ish_manager/scheduled_actions/_form_mini.haml
|
540
542
|
- app/views/ish_manager/scheduled_email_actions/_form.haml
|
543
|
+
- app/views/ish_manager/scheduled_email_actions/_form_mini.haml-trash
|
541
544
|
- app/views/ish_manager/scheduled_email_actions/edit.haml
|
542
545
|
- app/views/ish_manager/scheduled_email_actions/index.haml
|
543
546
|
- app/views/ish_manager/scheduled_email_actions/new.haml
|
File without changes
|