ish_manager 0.1.8.376 → 0.1.8.377
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/ish_manager/application.scss +8 -0
- data/app/assets/stylesheets/ish_manager/email.scss +1 -0
- data/app/controllers/ish_manager/scheduled_email_actions_controller.rb +18 -1
- data/app/views/ish_manager/application/_main_header_admin.haml +15 -13
- data/app/views/ish_manager/email_actions/_form.haml +11 -7
- data/app/views/ish_manager/email_actions/edit.haml +1 -1
- data/app/views/ish_manager/email_contexts/index.haml +8 -4
- data/app/views/ish_manager/email_templates/_form.haml +0 -4
- data/app/views/ish_manager/email_templates/_index.haml +4 -11
- data/app/views/ish_manager/email_templates/new.haml +4 -3
- data/app/views/ish_manager/scheduled_email_actions/_form.haml +1 -1
- data/app/views/ish_manager/scheduled_email_actions/index.haml +8 -3
- data/lib/tasks/office_tasks.rake +37 -1
- metadata +2 -2
- /data/lib/{tasks/done → tasks-done}/migrate.rake +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5421ad5b4dc558f6e168566d8bacc5db35ab266e1701abf9cfc5e7fefe605fd1
|
4
|
+
data.tar.gz: fdd493de49a5ace572f87d31f3c61d607bf205c793998f9136ec77a08ae1c7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ebe7d90b2bca5b0f029dd7e462ca72c338a61fd513f120ec2e645cd589c17572cdf9650c84a6404be263a74fe74e672fbfc2d7aa412813d6ef3f57fab6fc61d
|
7
|
+
data.tar.gz: 896955dcb964096acd99ddf8ef71e019ba213bf917b5291378d07584b203966dad014c30ea798e73fbd16c650b8c5d9a7916a9faa28125ed0ddbb2a7d874a261
|
@@ -25,7 +25,6 @@ class IshManager::ScheduledEmailActionsController < IshManager::ApplicationContr
|
|
25
25
|
def edit
|
26
26
|
@sch = Sch.find params[:id]
|
27
27
|
authorize! :edit, @sch
|
28
|
-
|
29
28
|
end
|
30
29
|
|
31
30
|
def index
|
@@ -38,5 +37,23 @@ class IshManager::ScheduledEmailActionsController < IshManager::ApplicationContr
|
|
38
37
|
authorize! :scheduled_emails_new, @scheduled_email_action
|
39
38
|
end
|
40
39
|
|
40
|
+
def show
|
41
|
+
@sch = Sch.find params[:id]
|
42
|
+
authorize! :show, @sch
|
43
|
+
redirect_to action: 'edit'
|
44
|
+
end
|
45
|
+
|
46
|
+
def update
|
47
|
+
@sch = Sch.find params[:id]
|
48
|
+
authorize! :update, @sch
|
49
|
+
flag = @sch.update_attributes( params[:sch].permit! )
|
50
|
+
if flag
|
51
|
+
flash[:notice] = "Success."
|
52
|
+
else
|
53
|
+
flash[:alert] = "No luck: #{@sch.errors.full_messages.join(',')}."
|
54
|
+
end
|
55
|
+
render action: 'edit'
|
56
|
+
end
|
57
|
+
|
41
58
|
end
|
42
59
|
|
@@ -44,29 +44,31 @@
|
|
44
44
|
= link_to "Inbox (#{Office::EmailConversation.in_inbox.length})", email_conversations_path
|
45
45
|
= link_to '[+]', new_email_context_path
|
46
46
|
%li
|
47
|
-
= link_to
|
48
|
-
= link_to '[+]',
|
49
|
-
= link_to 'unsent', notsent_email_contexts_path
|
47
|
+
= link_to "Templates (#{Ish::EmailTemplate.all.count})", email_templates_path
|
48
|
+
= link_to '[+]', new_email_template_path
|
50
49
|
%li
|
51
|
-
= link_to '
|
52
|
-
= link_to '
|
50
|
+
-# = link_to 'Contexts', email_contexts_path
|
51
|
+
= link_to 'Contexts', notsent_email_contexts_path
|
52
|
+
= link_to '[+]', new_email_context_path
|
53
|
+
-# %li
|
54
|
+
-# = link_to 'Campaigns', email_campaigns_path
|
55
|
+
-# = link_to '[+]', new_email_campaign_path
|
53
56
|
|
54
57
|
%li
|
55
|
-
= link_to
|
58
|
+
= link_to "Sch (#{Sch.active.length})", scheduled_email_actions_path
|
56
59
|
= link_to '[+]', new_scheduled_email_action_path
|
60
|
+
= link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
|
61
|
+
= link_to '[+]', new_email_action_path
|
57
62
|
%ul
|
63
|
+
%li
|
64
|
+
|
58
65
|
%li
|
59
|
-
= link_to "
|
60
|
-
= link_to '[+]', new_email_template_path
|
61
|
-
%li
|
62
|
-
= link_to "Leadsets (#{Leadset.kept.length})", leadsets_path
|
66
|
+
= link_to "Co's (#{Leadset.kept.length})", leadsets_path
|
63
67
|
= link_to '[+]', new_leadset_path
|
64
68
|
%li
|
65
69
|
= link_to "Leads (#{Lead.kept.length})", leads_path
|
66
70
|
= link_to '[+]', new_lead_path
|
67
|
-
|
68
|
-
= link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
|
69
|
-
= link_to '[+]', new_email_action_path
|
71
|
+
|
70
72
|
%li
|
71
73
|
= link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
|
72
74
|
= link_to '[+]', new_email_filter_path
|
@@ -23,13 +23,17 @@
|
|
23
23
|
|
24
24
|
.col-md-6
|
25
25
|
.field
|
26
|
-
%label Next
|
27
|
-
.eg
|
28
|
-
= f.text_field :
|
29
|
-
.field
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
%label Next At Exe
|
27
|
+
.eg rand(1..5).business_days.from_now.to_date + rand(8..16).hours + rand(1..59).minutes
|
28
|
+
= f.text_field :next_at_exe
|
29
|
+
-# .field
|
30
|
+
-# %label Next in Days
|
31
|
+
-# .eg eg: rand(1..5)
|
32
|
+
-# = f.text_field :next_in_days
|
33
|
+
-# .field
|
34
|
+
-# %label Next at Time
|
35
|
+
-# .eg eg: rand(8..16).hours + rand(1..59).minutes
|
36
|
+
-# = f.text_field :next_at_time
|
33
37
|
.field
|
34
38
|
%label Next Email Actions
|
35
39
|
= f.select :next_email_actions, options_for_select( @email_actions_list, selected: act.next_email_actions.map(&:id) ), { }, { class: 'select2', multiple: true }
|
@@ -15,7 +15,8 @@
|
|
15
15
|
%table.bordered.data-table
|
16
16
|
%thead
|
17
17
|
%tr
|
18
|
-
%th.actions
|
18
|
+
%th.actions
|
19
|
+
%th.from From
|
19
20
|
%th.to To
|
20
21
|
%th.subject Subject
|
21
22
|
%th.template Template
|
@@ -30,12 +31,15 @@
|
|
30
31
|
- else
|
31
32
|
= link_to '[~]', edit_email_context_path(ctx)
|
32
33
|
= button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
|
34
|
+
%td
|
35
|
+
= ctx.from_email ? ctx.from_email : "t| #{ctx.tmpl.from_email}"
|
33
36
|
%td= ctx.to_email
|
34
37
|
%td
|
35
|
-
= link_to
|
38
|
+
= link_to email_context_path(ctx) do
|
39
|
+
= ctx.subject ? ctx.subject : "t| #{ctx.tmpl.subject}"
|
36
40
|
%td= ctx.email_template.slug
|
37
|
-
%td= ctx.created_at.strftime('%Y-%m-%d')
|
38
|
-
%td= ctx.updated_at.strftime('%Y-%m-%d')
|
41
|
+
%td= ctx.created_at.strftime('%Y-%m-%d %l:%M%P %:z')
|
42
|
+
%td= ctx.updated_at.strftime('%Y-%m-%d %l:%M%P %:z')
|
39
43
|
|
40
44
|
|
41
45
|
= render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
|
@@ -1,18 +1,15 @@
|
|
1
1
|
|
2
2
|
%h3.center.collapse-expand#emailTemplatesIndex
|
3
3
|
Email Templates (#{Ish::EmailTemplate.all.count})
|
4
|
-
.email-templates-index
|
5
|
-
|
6
|
-
-# = render 'ish_manager/email_templates/form_mini'
|
7
4
|
|
5
|
+
.email-templates-index.max-width
|
8
6
|
%table.bordered
|
9
7
|
%tr
|
10
|
-
%th
|
8
|
+
%th
|
11
9
|
%th Slug
|
12
10
|
%th Created
|
13
11
|
%th Updated
|
14
12
|
|
15
|
-
|
16
13
|
- @templates.each do |tmpl|
|
17
14
|
%tr
|
18
15
|
%td
|
@@ -20,10 +17,6 @@
|
|
20
17
|
= link_to '[~]', edit_email_template_path({ id: tmpl })
|
21
18
|
= button_to '[x]', email_template_path({ id: tmpl }), method: :delete, :data => { :confirm => 'Are you sure?' }, form_class: 'inline'
|
22
19
|
%td= link_to tmpl.slug, email_template_path({ id: tmpl })
|
23
|
-
%td= tmpl.created_at
|
24
|
-
%td= tmpl.updated_at
|
25
|
-
|
26
|
-
-# = link_to 'iFrame', email_template_iframe_path({ id: tmpl }), target: :_blank
|
27
|
-
|
28
|
-
%hr
|
20
|
+
%td= pp_date tmpl.created_at
|
21
|
+
%td= pp_date tmpl.updated_at
|
29
22
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
- url = sch_a.new_record? ? scheduled_email_actions_path : scheduled_email_action_path(sch_a.id)
|
8
8
|
|
9
9
|
.scheduled-email-actions--form
|
10
|
-
= form_for scheduled_email_action, url: url, html: { class: "form-mini" } do |f|
|
10
|
+
= form_for scheduled_email_action, url: url, as: :sch, html: { class: "form-mini" } do |f|
|
11
11
|
.header
|
12
12
|
%h5.title Schedule an email action
|
13
13
|
|
@@ -10,8 +10,13 @@
|
|
10
10
|
.items
|
11
11
|
- @scheduled_email_actions.each do |sch|
|
12
12
|
.item
|
13
|
-
|
13
|
+
.flex-row
|
14
|
+
.gray= sch.id
|
15
|
+
= link_to '[~]', edit_scheduled_email_action_path(sch)
|
16
|
+
|
14
17
|
%ul
|
15
|
-
|
18
|
+
%li <b>Act:</b> #{link_to sch.email_action.slug, edit_email_action_path(sch.email_action)}
|
16
19
|
%li <b>Tmpl:</b> #{sch.email_action.email_template.slug}
|
17
|
-
%li <b>Lead:</b> #{sch.lead.email}
|
20
|
+
%li <b>Lead:</b> #{link_to sch.lead.email, lead_path(sch.lead) }
|
21
|
+
%li <b>State:</b> #{sch.state}
|
22
|
+
%li <b>Perform at:</b> #{sch.perform_at}
|
data/lib/tasks/office_tasks.rake
CHANGED
@@ -6,6 +6,43 @@ end
|
|
6
6
|
|
7
7
|
namespace :office do
|
8
8
|
|
9
|
+
desc 'schheduled email actions, rolling perform'
|
10
|
+
task :schs => :environment do
|
11
|
+
while true do
|
12
|
+
|
13
|
+
Sch.active.where({ :perform_at.lte => Time.now }).each do |sch|
|
14
|
+
sch.update_attributes({ state: Sch::STATE_INACTIVE })
|
15
|
+
|
16
|
+
# send now
|
17
|
+
ctx = Ctx.new({
|
18
|
+
email_template_id: sch.act.tmpl.id,
|
19
|
+
lead_id: sch.lead.id,
|
20
|
+
send_at: Time.now,
|
21
|
+
})
|
22
|
+
ctx.save!
|
23
|
+
|
24
|
+
# schedule the next action & update the action
|
25
|
+
next_at = eval(sch.act.next_at_exe)
|
26
|
+
sch.act.next_email_actions.each do |nxt|
|
27
|
+
sch_nxt = Sch.find_or_initialize_by({
|
28
|
+
lead_id: sch.lead_id,
|
29
|
+
email_action_id: nxt.id,
|
30
|
+
})
|
31
|
+
sch_nxt.perform_at = next_at
|
32
|
+
sch_nxt.state = Sch::STATE_ACTIVE
|
33
|
+
sch_nxt.save!
|
34
|
+
end
|
35
|
+
|
36
|
+
print '.'
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
# sleep 1.minute
|
41
|
+
sleep 10.seconds
|
42
|
+
print '|'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
9
46
|
desc "send emails"
|
10
47
|
task :email_worker => :environment do
|
11
48
|
while true do
|
@@ -20,7 +57,6 @@ namespace :office do
|
|
20
57
|
# sleep 1.minute
|
21
58
|
sleep 10.seconds
|
22
59
|
print '^'
|
23
|
-
|
24
60
|
end
|
25
61
|
end
|
26
62
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.377
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -571,7 +571,7 @@ files:
|
|
571
571
|
- lib/systemd/system/README.txt
|
572
572
|
- lib/systemd/system/stockwatcher.service
|
573
573
|
- lib/systemd/system/watch_stocks.service
|
574
|
-
- lib/tasks
|
574
|
+
- lib/tasks-done/migrate.rake
|
575
575
|
- lib/tasks/ish_manager_tasks.rake
|
576
576
|
- lib/tasks/office_tasks.rake
|
577
577
|
homepage: http://wasya.co
|
File without changes
|