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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b3a788b6e7e83e53fdbf17a632d57eb0d506ca7bf5c8127396d5c8e39070f01
4
- data.tar.gz: 71361bf035d9484a5de3b4c01193f938828e8ba3e1e01676bc8a30faab4b2c71
3
+ metadata.gz: 3041801c1b15c0929b1b230aa72313e7de831fb3609afc1cec4dd664b8422af1
4
+ data.tar.gz: d2b711abd1fa459dfcdce279a58045d0cffab9ba1a00050deb511ef21083816b
5
5
  SHA512:
6
- metadata.gz: 1e83bdd682a7a94e681af8ae269380eb15afd8078f055a6058d997dcf1e4a58944b57f5279e25727302bbaf7ae9712b72d941340c6f7bbf5ac453661faa32bd3
7
- data.tar.gz: fe8ed81b42f3b4195c407fdbfcb45c194db504181c7918e8c9054e72c70cd58826b033630244302096dc76d8e82c03168af9fd9f3dd9fdb282a9499e04b52a5b
6
+ metadata.gz: 49543de291e21a10bbf953b4a432d04fa665b81b7c9b7d5b58daf9b2bfa8d8c6ad83ffc178f077bed668835a3e60d9e11b1d41a9805c08a8b481c0664d29adbf
7
+ data.tar.gz: 8a7cc1777b3e019742179abcacb9108fecca78d65e795074cb022af1d5cf5be033176720d5c9dee093edc0ef5b659b5bd7c137b7832ad30d99a408d32a9ebc88
@@ -1,7 +1,5 @@
1
-
2
1
  require 'business_time'
3
2
 
4
-
5
3
  class IshManager::ApplicationController < ActionController::Base
6
4
 
7
5
  protect_from_forgery :with => :exception, :prepend => true
@@ -0,0 +1,10 @@
1
+
2
+ class IshManager::ApplicationMailerController < ActionController::Base
3
+ helper IshManager::ApplicationHelper
4
+
5
+ def url_options
6
+ {
7
+ host: 'test-host',
8
+ }
9
+ end
10
+ end
@@ -38,17 +38,6 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
38
38
  redirect_to action: :index
39
39
  end
40
40
 
41
- def do_send
42
- @ctx = ::Ish::EmailContext.find params[:id]
43
- authorize! :do_send, @ctx
44
-
45
- flash[:notice] = 'Scheduled a single send - v2'
46
- @ctx.send_at = Time.now
47
- @ctx.save
48
-
49
- redirect_to action: 'index'
50
- end
51
-
52
41
  def edit
53
42
  @ctx = ::Ish::EmailContext.find params[:id]
54
43
  authorize! :edit, @ctx
@@ -93,6 +82,28 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
93
82
  @ctx = ::Ish::EmailContext.new({ email_template: @tmpl }.merge(attrs))
94
83
  end
95
84
 
85
+ def send_immediate
86
+ @ctx = ::Ish::EmailContext.find params[:id]
87
+ authorize! :do_send, @ctx
88
+ flash[:notice] = 'Sent immediately.'
89
+
90
+ out = IshManager::OfficeMailer.send_context_email( @ctx[:id].to_s )
91
+ Rails.env.production? ? out.deliver_later : out.deliver_now
92
+
93
+ redirect_to action: 'index'
94
+ end
95
+
96
+ def send_schedule
97
+ @ctx = ::Ish::EmailContext.find params[:id]
98
+ authorize! :do_send, @ctx
99
+
100
+ flash[:notice] = 'Scheduled a single send - v2'
101
+ @ctx.send_at = Time.now
102
+ @ctx.save
103
+
104
+ redirect_to action: 'index'
105
+ end
106
+
96
107
  def show
97
108
  @ctx = @email_context = ::Ish::EmailContext.find( params[:id] )
98
109
  authorize! :show, @ctx
@@ -17,9 +17,11 @@ class ::IshManager::EmailConversationsController < IshManager::ApplicationContro
17
17
  if params[:slug]
18
18
  @email_conversations = @email_conversations.in_emailtag( params[:slug] )
19
19
  end
20
+
20
21
  if params[:not_slug]
21
- @email_conversations = @email_conversations.not_in_emailtag(params[:not_slug])
22
+ @email_conversations = @email_conversations.not_in_emailtag( params[:not_slug] )
22
23
  end
24
+
23
25
  @email_conversations = @email_conversations.order_by( latest_at: :desc
24
26
  ).page( params[:conv_page]
25
27
  ).per( per_page )
@@ -38,8 +38,12 @@ module IshManager
38
38
  ## O
39
39
  ##
40
40
 
41
+ # def self.obfuscate link
42
+ # obf = Office::ObfuscatedRedirect.find_or_create_by({ to: link })
43
+ # return Ishapi::Engine.routes.url_helpers.obf_url( obf.id )
44
+ # end
41
45
  def obfuscate link
42
- puts! link, 'obfuscate helper'
46
+ # puts! link, 'obfuscate helper'
43
47
  obf = Office::ObfuscatedRedirect.find_or_create_by({ to: link })
44
48
  return Ishapi::Engine.routes.url_helpers.obf_url( obf.id )
45
49
  end
@@ -1,7 +1,9 @@
1
1
 
2
2
  module IshManager
3
3
  class ApplicationMailer < ActionMailer::Base
4
- default from: 'WasyaCo Consulting <no-reply@wasya.co>'
4
+ default from: 'WasyaCo Consulting <no-reply@wco.com.de>'
5
+ helper(IshManager::ApplicationHelper)
6
+
5
7
  layout 'mailer'
6
8
 
7
9
  def shared_galleries profiles, gallery
@@ -1,10 +1,10 @@
1
1
 
2
2
  class IshManager::OfficeMailer < IshManager::ApplicationMailer
3
- default from: 'WasyaCo Consulting & Software Development <no-reply@mail.wasyaco.com>'
4
3
 
5
4
  ## 2023-04-02 _vp_ Continue.
6
5
  def send_context_email ctx_id
7
- @ctx = Ctx.find ctx_id
6
+ @ctx = Ctx.find ctx_id
7
+ @lead = Lead.find @ctx.lead_id
8
8
 
9
9
  @utm_tracking_str = {
10
10
  'cid' => @ctx.lead_id,
@@ -13,25 +13,43 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
13
13
  'utm_source' => @ctx.tmpl.slug,
14
14
  }.map { |k, v| "#{k}=#{v}" }.join("&")
15
15
 
16
- ac = ActionController::Base.new
17
- ac.instance_variable_set( :@ctx, @ctx )
18
- ac.instance_variable_set( :@lead, @ctx.lead )
19
- ac.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
16
+ @domain = Rails.application.config.action_mailer.default_url_options[:host]
17
+ @origin = "https://#{Rails.application.config.action_mailer.default_url_options[:host]}"
18
+
19
+ @unsubscribe_url = Ishapi::Engine.routes.url_helpers.email_unsubscribes_url({
20
+ host: 'text-host-3',
21
+ template_id: @ctx.tmpl.id,
22
+ lead_id: @lead.id,
23
+ token: @lead.unsubscribe_token,
24
+ })
25
+ # renderer = Tmp6Ctl.new
26
+ # renderer = IshManager::ApplicationController.new
27
+ # renderer.send( :include, ::IshManager::ApplicationHelper )
28
+ # renderer.send( :request, { host: 'test-host' } )
29
+ renderer = IshManager::ApplicationMailer.new
30
+
31
+
32
+ renderer.instance_variable_set( :@ctx, @ctx )
33
+ renderer.instance_variable_set( :@lead, @ctx.lead )
34
+ renderer.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
35
+ renderer.instance_variable_set( :@unsubscribe_url, @unsubscribe_url )
36
+
37
+ eval( @ctx.tmpl.config_exe )
20
38
 
21
39
  if 'plain' == @ctx.tmpl.layout
22
40
  rendered_str = ERB.new( @ctx.body ).result( @ctx.get_binding )
23
41
  else
24
- rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@ctx.tmpl.layout}")
42
+ rendered_str = renderer.render_to_string("ish_manager/email_templates/_#{@ctx.tmpl.layout}")
25
43
  end
26
44
  @ctx.update({
27
45
  rendered_str: rendered_str,
28
46
  sent_at: Time.now.to_s,
29
47
  })
30
48
 
31
- mail( from: @ctx.from_email,
32
- to: @ctx.to_email,
49
+ mail( from: @ctx.from_email,
50
+ to: @ctx.to_email,
33
51
  subject: ERB.new( @ctx.subject ).result( @ctx.get_binding ),
34
- body: rendered_str,
52
+ body: rendered_str,
35
53
  content_type: "text/html" )
36
54
  end
37
55
 
@@ -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), {}, class: 'select2'
24
+ = f.select :from_email, options_for_select(Ish::EmailTemplate.from_email_list, selected: campaign.from_email), {}, class: 'select2'
25
25
 
26
26
  .actions
27
27
  = f.submit 'Submit'
@@ -12,7 +12,7 @@
12
12
 
13
13
  .field
14
14
  = f.label "From"
15
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: ctx.from_email)
15
+ = f.select :from_email, options_for_select(Ish::EmailTemplate.from_email_list, selected: ctx.from_email)
16
16
 
17
17
  .field.flex-row
18
18
  = f.label "To lead"
@@ -1,5 +1,7 @@
1
1
 
2
2
  .email-contexts-edit.max-width
3
3
  .header
4
- %h2.title Edit email Context
4
+ %h2.title
5
+ Edit email Context
6
+ = link_to "[view]", email_context_path( @ctx )
5
7
  = render 'ish_manager/email_contexts/form', ctx: @ctx, tmpl: @tmpl
@@ -3,7 +3,6 @@
3
3
 
4
4
  .header.collapse-expand-trash#emailContextsIndex
5
5
  %h2.title
6
-
7
6
  Email Contexts (#{@ctxs.length})
8
7
  - if @lead
9
8
  For lead #{@lead.email}
@@ -33,12 +32,14 @@
33
32
  %tbody
34
33
  - @ctxs.each do |ctx|
35
34
  %tr
36
- %td.actions
35
+ %td.actions.padded
37
36
  - if ctx.sent_at
38
- [~]
37
+ \--
39
38
  - else
40
- = link_to '[~]', edit_email_context_path(ctx)
41
- = button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
39
+ = link_to '[~]', edit_email_context_path(ctx)
40
+ = button_to 'x', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
41
+ = button_to 'send', send_immediate_email_context_path(ctx), form_class: :inline, data: { confirm: 'Are you sure?' }
42
+
42
43
  %td.from
43
44
  = ctx.from_email ? ctx.from_email : "t| #{ctx.tmpl.from_email}"
44
45
  %td.to= link_to ctx.lead.email, lead_path(ctx.lead)
@@ -4,23 +4,22 @@
4
4
  %h2.title Email Context
5
5
 
6
6
  .row
7
- .col-md-4
7
+ .col-md-6
8
8
  %ul
9
+ %li <b>Template:</b> #{link_to @ctx.email_template.slug, email_template_path(@ctx.email_template), target: :_blank }
10
+ %li <b>Layout:</b> #{@ctx.email_template.layout}
11
+ %hr
9
12
  %li <b>From:</b> #{@ctx.from_email}
10
13
  %li <b>To Lead:</b> #{link_to @ctx.lead.email, lead_path(@ctx.lead)}
11
14
  %li <b>Subject:</b> #{@ctx.subject}
12
15
 
13
- .col-md-4
14
- %ul
15
- %li <b>Template:</b> #{link_to @ctx.email_template.slug, email_template_path(@ctx.email_template), target: :_blank }
16
- %li <b>Layout:</b> #{@ctx.email_template.layout}
17
16
 
18
- .col-md-4
17
+ .col-md-6
19
18
  %ul
20
19
  %li <b>Send at:</b> #{@ctx.send_at&.strftime('%Y-%m-%d %l:%M%P')}
21
20
  %li <b>Sent at:</b> #{@ctx.sent_at&.strftime('%Y-%m-%d %l:%M%P')}
22
21
  %li
23
- = button_to 'Send', send_email_context_path(@ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
22
+ = button_to 'Send', send_immediate_email_context_path(@ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
24
23
  = link_to '[~]', edit_email_context_path(@ctx)
25
24
 
26
25
  .max-width
@@ -13,10 +13,8 @@
13
13
 
14
14
  201 W 5th St 11th Floor, Austin, TX 78701<br><br>
15
15
 
16
- Want to change how you receive these emails?<br>
17
-
18
- You can <%= link_to 'update your preferences', @update_preferences_url %> or
19
-
16
+ Want to change how you receive these emails? You can <br>
17
+ <%= link_to 'update your preferences', '#' %> or
20
18
  <%= link_to 'unsubscribe from this list', @unsubscribe_url %>.<br><br>
21
19
 
22
20
  </td>
@@ -15,7 +15,7 @@
15
15
  .col-md-4
16
16
  .field
17
17
  = f.label "From"
18
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
18
+ = f.select :from_email, options_for_select(Ish::EmailTemplate.from_email_list, selected: email_template.from_email)
19
19
  .field.field-subject
20
20
  = f.label :subject
21
21
  = f.text_field :subject
@@ -39,6 +39,10 @@
39
39
  -# .descr= render "ish_manager/email_templates/#{email_template.layout}", ctx: Ish::EmailContext.new, tmpl: email_template
40
40
  %iframe{ src: email_template_iframe_path(email_template), width: '100%', height: '100%' }
41
41
 
42
+ .field
43
+ = f.label :config_json
44
+ = f.text_area :config_json
45
+
42
46
  .field
43
47
  = f.label :config_exe
44
48
  = f.text_area :config_exe
@@ -3,6 +3,7 @@
3
3
 
4
4
  %h3.center.collapse-expand#emailTemplatesIndex
5
5
  Email Templates (#{Ish::EmailTemplate.all.count})
6
+ = link_to '[+]', new_email_template_path
6
7
 
7
8
  = paginate @templates, :param_name => :templates_page, :views_prefix => 'ish_manager'
8
9
  .email-templates-index.max-width
@@ -840,7 +840,7 @@
840
840
  <td align="center" valign="middle" class="mcnButtonContent"
841
841
  style="font-family: Helvetica; font-size: 18px; padding: 18px;">
842
842
  <a class="mcnButton " title="Wasya Co Project Intake for ReactJs Development"
843
- href="https://wasya.co/contact-us-2/" target="_blank"
843
+ href="https://wasyaco.com/contact-us-2/" target="_blank"
844
844
  style="font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;"
845
845
  >Tell us About your Project!</a>
846
846
  </td>
@@ -1040,7 +1040,7 @@
1040
1040
  style="font-family: Helvetica; font-size: 18px;">
1041
1041
  <a class="mcnButton "
1042
1042
  title="Wasya Co Project Intake for ReactJs Development"
1043
- href="https://wasya.co/our-work/" target="_blank"
1043
+ href="https://wasyaco.com/our-work/" target="_blank"
1044
1044
  style="padding: 18px; font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;"
1045
1045
  >See Our Successful <br />ReactJs Deliveries</a>
1046
1046
  </td>