ish_manager 0.1.8.469 → 0.1.8.471
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ish_manager/application_controller.rb +0 -2
- data/app/controllers/ish_manager/application_mailer_controller.rb +10 -0
- data/app/controllers/ish_manager/email_contexts_controller.rb +22 -11
- data/app/controllers/ish_manager/email_conversations_controller.rb +3 -1
- data/app/helpers/ish_manager/application_helper.rb +5 -1
- data/app/mailers/ish_manager/application_mailer.rb +3 -1
- data/app/mailers/ish_manager/office_mailer.rb +28 -10
- data/app/views/ish_manager/email_campaigns/_form.haml +1 -1
- data/app/views/ish_manager/email_contexts/_form.haml +1 -1
- data/app/views/ish_manager/email_contexts/edit.haml +3 -1
- data/app/views/ish_manager/email_contexts/index.haml +6 -5
- data/app/views/ish_manager/email_contexts/show.haml +6 -7
- data/app/views/ish_manager/email_templates/_footer_unsubscribe.html.erb +2 -4
- data/app/views/ish_manager/email_templates/_form.haml +5 -1
- data/app/views/ish_manager/email_templates/_index.haml +1 -0
- data/app/views/ish_manager/email_templates/_m20221201react.html.erb +2 -2
- data/app/views/ish_manager/email_templates/_m202309_ror4.html.erb +985 -0
- data/config/routes.rb +7 -6
- data/lib/ish_manager.rb +0 -2
- data/lib/tasks/office_tasks.rake +7 -15
- metadata +4 -6
- data/app/mailers/ish_manager/meeting_mailer.rb +0 -13
- data/app/mailers/ish_manager/offier_mailer.rb-trash +0 -53
- data/app/views/ish_manager/email_templates/done/_form.haml +0 -22
- data/app/views/ish_manager/email_templates/done/_form2.haml +0 -26
data/config/routes.rb
CHANGED
@@ -87,14 +87,15 @@ IshManager::Engine.routes.draw do
|
|
87
87
|
get 'email_conversations', to: 'email_conversations#index'
|
88
88
|
get 'email_conversations/in/:slug', to: 'email_conversations#index', as: :email_conversations_in
|
89
89
|
get 'email_conversations/notin/:not_slug', to: 'email_conversations#index', as: :email_conversations_notin
|
90
|
-
get 'email_conversations/show/:id', to: 'email_conversations#show',
|
90
|
+
get 'email_conversations/show/:id', to: 'email_conversations#show', as: :email_conversation
|
91
91
|
|
92
|
-
get 'email_contexts/summary', to: 'email_contexts#summary',
|
93
|
-
get 'email_contexts/for_lead/:lead_id', to: 'email_contexts#index',
|
94
|
-
get 'email_contexts/iframe_src/:id', to: 'email_contexts#iframe_src',
|
92
|
+
get 'email_contexts/summary', to: 'email_contexts#summary', as: :email_contexts_summary
|
93
|
+
get 'email_contexts/for_lead/:lead_id', to: 'email_contexts#index', as: :email_contexts_for_lead
|
94
|
+
get 'email_contexts/iframe_src/:id', to: 'email_contexts#iframe_src', as: :email_context_iframe
|
95
95
|
get 'email_contexts/new_with_template/:template_slug', to: 'email_contexts#new'
|
96
|
-
post 'email_contexts/
|
97
|
-
|
96
|
+
post 'email_contexts/send_schedule/:id', to: 'email_contexts#send_schedule', as: :send_schedule_email_context
|
97
|
+
post 'email_contexts/send_immediate/:id', to: 'email_contexts#send_immediate', as: :send_immediate_email_context
|
98
|
+
get 'email_contexts', to: 'email_contexts#index', as: :email_contexts
|
98
99
|
resources :email_contexts
|
99
100
|
|
100
101
|
get 'email_templates/iframe_src/:id', to: 'email_templates#iframe_src', as: :email_template_iframe
|
data/lib/ish_manager.rb
CHANGED
data/lib/tasks/office_tasks.rake
CHANGED
@@ -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
|
@@ -54,21 +51,15 @@ namespace :office do
|
|
54
51
|
ctxs = ::Ish::EmailContext.scheduled.notsent
|
55
52
|
ctxs.map do |ctx|
|
56
53
|
|
57
|
-
|
58
|
-
throw "@TODO: continue iterating here. _vp_ 2023-09-18"
|
59
|
-
|
60
|
-
unsub = Ish::EmailUnsubscribe.where({ lead_id: ctx.lead_id, template_id: ctx.template_id }).first
|
54
|
+
unsub = Ish::EmailUnsubscribe.where({ lead_id: ctx.lead_id, template_id: ctx.template_id }).first
|
61
55
|
if unsub
|
62
|
-
template
|
63
|
-
puts! "Lead `#{ctx.lead.full_name}` [mailto:#{ctx.lead.email}] has already unsubscribed from template `#{template.slug}` ."
|
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}` ." })
|
64
57
|
email_action_ids = EAction.where({ email_template_id: ctx.template_id }).map(&:id)
|
65
|
-
|
58
|
+
schs = Sch.active.where({
|
66
59
|
lead_id: ctx.lead_id,
|
67
60
|
:email_action_id.in => email_action_ids,
|
68
61
|
})
|
69
|
-
|
70
|
-
state: Office::ScheduledEmailAction::STATE_UNSUBSCRIBED,
|
71
|
-
})
|
62
|
+
schs.update({ state: Office::ScheduledEmailAction::STATE_UNSUBSCRIBED })
|
72
63
|
end
|
73
64
|
|
74
65
|
out = IshManager::OfficeMailer.send_context_email( ctx[:id].to_s )
|
@@ -79,6 +70,7 @@ namespace :office do
|
|
79
70
|
duration = Rails.env.production? ? 120 : 15 # 2 minutes or 15 seconds
|
80
71
|
sleep duration
|
81
72
|
print '.'
|
73
|
+
|
82
74
|
end
|
83
75
|
end
|
84
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.
|
4
|
+
version: 0.1.8.471
|
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-
|
11
|
+
date: 2023-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -483,6 +483,7 @@ files:
|
|
483
483
|
- app/controllers/ish_manager/appliance_tmpls_controller.rb
|
484
484
|
- app/controllers/ish_manager/appliances_controller.rb
|
485
485
|
- app/controllers/ish_manager/application_controller.rb
|
486
|
+
- app/controllers/ish_manager/application_mailer_controller.rb
|
486
487
|
- app/controllers/ish_manager/categories_controller.rb
|
487
488
|
- app/controllers/ish_manager/email_actions_controller.rb
|
488
489
|
- app/controllers/ish_manager/email_campaign_leads_controller.rb
|
@@ -528,9 +529,7 @@ files:
|
|
528
529
|
- app/jobs/ish_manager/test_email_job.rb
|
529
530
|
- app/mailers/ish_manager/application_mailer.rb
|
530
531
|
- app/mailers/ish_manager/leadset_mailer.rb
|
531
|
-
- app/mailers/ish_manager/meeting_mailer.rb
|
532
532
|
- app/mailers/ish_manager/office_mailer.rb
|
533
|
-
- app/mailers/ish_manager/offier_mailer.rb-trash
|
534
533
|
- app/models/ish_manager/ability.rb
|
535
534
|
- app/views/202212 Mailchimp Templates/202212 1col fixed-width.html
|
536
535
|
- app/views/202212 Mailchimp Templates/202212 1col full-width.html
|
@@ -666,6 +665,7 @@ files:
|
|
666
665
|
- app/views/ish_manager/email_templates/_m202309_holiday_thanksgiving.html.erb
|
667
666
|
- app/views/ish_manager/email_templates/_m202309_holiday_valentines.html.erb
|
668
667
|
- app/views/ish_manager/email_templates/_m202309_holiday_veterans_day.html.erb
|
668
|
+
- app/views/ish_manager/email_templates/_m202309_ror4.html.erb
|
669
669
|
- app/views/ish_manager/email_templates/_marketing_node_1.html.erb
|
670
670
|
- app/views/ish_manager/email_templates/_marketing_react_1.html
|
671
671
|
- app/views/ish_manager/email_templates/_marketing_react_2.html.erb
|
@@ -688,8 +688,6 @@ files:
|
|
688
688
|
- app/views/ish_manager/email_templates/_tracking_footer.html.erb
|
689
689
|
- app/views/ish_manager/email_templates/_wasyaco_roundborders.html.erb
|
690
690
|
- app/views/ish_manager/email_templates/_wasyaco_social.html.erb
|
691
|
-
- app/views/ish_manager/email_templates/done/_form.haml
|
692
|
-
- app/views/ish_manager/email_templates/done/_form2.haml
|
693
691
|
- app/views/ish_manager/email_templates/edit.haml
|
694
692
|
- app/views/ish_manager/email_templates/iframe_src.haml
|
695
693
|
- app/views/ish_manager/email_templates/index.haml
|
@@ -1,13 +0,0 @@
|
|
1
|
-
|
2
|
-
class IshManager::MeetingMailer < IshManager::ApplicationMailer
|
3
|
-
default from: 'WasyaCo Consulting <no-reply@wasya.co>'
|
4
|
-
|
5
|
-
# layout 'mailer'
|
6
|
-
|
7
|
-
def morning_reminder meeting_id:
|
8
|
-
@meeting = Ish::Meeting.find meeting_id
|
9
|
-
mail( to: @meeting.invitee_email,
|
10
|
-
subject: 'A reminder for your upcoming meeting' )
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
def send_campaign_email campaign_id, c_lead_id
|
4
|
-
@ctx = @campaign = ::Ish::EmailContext.find campaign_id
|
5
|
-
@lead = EmailCampaignLead.find c_lead_id
|
6
|
-
|
7
|
-
if @lead.sent_at
|
8
|
-
raise "This campaign_lead #{@lead.id} has already been sent."
|
9
|
-
end
|
10
|
-
|
11
|
-
actl = ActionController::Base.new
|
12
|
-
actl.instance_variable_set( :@ctx, @ctx )
|
13
|
-
|
14
|
-
@pixel_tracking = {
|
15
|
-
'v' => 1,
|
16
|
-
'tid' => 'UA-53077236-2',
|
17
|
-
'cid' => @lead.cid,
|
18
|
-
'uid' => @lead.uid,
|
19
|
-
't' => 'event',
|
20
|
-
'ec' => 'email',
|
21
|
-
'ea' => 'open',
|
22
|
-
'cn' => @campaign.slug,
|
23
|
-
'ci' => @campaign.slug,
|
24
|
-
'cm' => 'email',
|
25
|
-
'utm_source' => @campaign.slug,
|
26
|
-
'utm_medium' => 'email',
|
27
|
-
'utm_campaign' => @campaign.slug,
|
28
|
-
}.map { |k, v| "#{k}=#{v}" }.join("&")
|
29
|
-
actl.instance_variable_set( :@pixel_tracking, @pixel_tracking )
|
30
|
-
|
31
|
-
@click_tracking = {
|
32
|
-
'cid' => @lead.cid,
|
33
|
-
'uid' => @lead.uid,
|
34
|
-
't' => 'event',
|
35
|
-
'ec' => 'email',
|
36
|
-
'ea' => 'clk-ctct', # clicked contact us
|
37
|
-
'utm_source' => @campaign.slug,
|
38
|
-
'utm_medium' => 'email',
|
39
|
-
'utm_campaign' => @campaign.slug,
|
40
|
-
}.map { |k, v| "#{k}=#{v}" }.join("&")
|
41
|
-
actl.instance_variable_set( :@click_tracking, @click_tracking )
|
42
|
-
|
43
|
-
actl.instance_variable_set( :@lead, @lead )
|
44
|
-
|
45
|
-
template = "render/_#{@ctx.email_template.slug}"
|
46
|
-
rendered_str = actl.render_to_string("ish_manager/email_templates/_#{@ctx.email_template.slug}")
|
47
|
-
@lead.update( rendered_str: rendered_str, sent_at: Time.now )
|
48
|
-
|
49
|
-
mail( from: @ctx.from_email,
|
50
|
-
to: @lead.email,
|
51
|
-
subject: @ctx.subject,
|
52
|
-
template_name: template )
|
53
|
-
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'
|