ish_manager 0.1.8.470 → 0.1.8.472

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: 83591733d1b01247d332cf8f8530b2054de05f46cc11dba6869193a5b32a1ccb
4
- data.tar.gz: 4f1443e9c20101dc1b24a7a889478b85933c95c4587e356849bbb49ccbd43711
3
+ metadata.gz: c62690a4c94c77e292b242fce0e1735d0ed6829124464b5a4f7a9808235a27f0
4
+ data.tar.gz: 5862d542efe19771afe459ae6ff77204cccde6f091fc2ddd9df34e26d7a1ecbe
5
5
  SHA512:
6
- metadata.gz: b1af535f9b4559c5c884741f743a5b6ca0b14bc59b409b7db34ce92d4de345648275ea3826b17f12b43fcad1ed828b6588d538ea3d78e3035a0fb4a6436cf4b4
7
- data.tar.gz: 5c148eddff5913d73ec126c112801ef1881e868a796b90d8414e30b61012b66f55804bb09cd145f2f19c6b2f569919ca866729e6b2ef39dc79b5c712bdb48d51
6
+ metadata.gz: ada02e23bcbb43ebecfd75ff5a57a9f035ee00a1fe331e3803bc09ad76344f88101e774448b6c4ced6f6b0d473c05db5c1d68f9a42c1a37c5c87ffe4c27dcd8c
7
+ data.tar.gz: 87301838fdf49854e3d8c87281f3cdaa0ee29578eac909dbed66dd3fac461f014351ee89078eb5556497ed37c6dd85667b6d6dfd69dbf642721d7e867ad1f174
@@ -3,7 +3,7 @@
3
3
  $(document).ready(function () {
4
4
 
5
5
  const jwt_token = $("#Config").data('jwt-token')
6
- logg(jwt_token, 'jwt_token')
6
+ // logg(jwt_token, 'jwt_token')
7
7
 
8
8
  if ($(".invoices-new").length) {
9
9
 
@@ -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
@@ -2,6 +2,8 @@
2
2
  module IshManager
3
3
  class ApplicationMailer < ActionMailer::Base
4
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 Mailer <no-reply@wco.com.de>'
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,
@@ -16,10 +16,23 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
16
16
  @domain = Rails.application.config.action_mailer.default_url_options[:host]
17
17
  @origin = "https://#{Rails.application.config.action_mailer.default_url_options[:host]}"
18
18
 
19
- renderer = ActionController::Base.new
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
+
20
32
  renderer.instance_variable_set( :@ctx, @ctx )
21
33
  renderer.instance_variable_set( :@lead, @ctx.lead )
22
34
  renderer.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
35
+ renderer.instance_variable_set( :@unsubscribe_url, @unsubscribe_url )
23
36
 
24
37
  eval( @ctx.tmpl.config_exe )
25
38
 
@@ -1,5 +1,7 @@
1
1
 
2
2
  #Config{ data: { jwt_token: @jwt_token } }
3
+ :javascript
4
+ localStorage.setItem('jwt_token', $("#Config").data('jwt-token') )
3
5
 
4
6
  .manager--main-footer
5
7
  .max-width
@@ -23,10 +25,11 @@
23
25
 
24
26
  .col-sm-4
25
27
  = button_to 'Logout', main_app.destroy_user_session_path, :method => :delete, data: { confirm: 'Are you sure?' }
26
- .set-jwt-token
27
28
 
28
- = button_tag 'Set JWT', class: 'set-jwt-token'
29
- .jwt-token
29
+ -# .set-jwt-token
30
+ -# = button_tag 'Set JWT', class: 'set-jwt-token'
31
+ -# .jwt-token
32
+
30
33
  = form_for @current_profile, url: profile_path(@current_profile), as: :profile do |f|
31
34
  .flex-row
32
35
  = f.label :per_page
@@ -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
@@ -30,6 +30,10 @@
30
30
  %i.material-icons refresh
31
31
  refresh
32
32
 
33
+ %br
34
+ %br
35
+ = render 'paginate', resource: @email_conversations, param_name: :conv_page, views_prefix: :ish_manager
36
+
33
37
  %table.conversations
34
38
  %tr
35
39
  %th
@@ -42,7 +46,6 @@
42
46
  %th Datetime
43
47
  %th Tags
44
48
 
45
- = render 'paginate', resource: @email_conversations, param_name: :conv_page, views_prefix: :ish_manager
46
49
  - @email_conversations.each do |conv|
47
50
  %tr{ class: [ conv.state ] }
48
51
  .item
@@ -65,4 +68,7 @@
65
68
  - conv.tags.each do |tag|
66
69
  .chip
67
70
  = tag.name
68
- = render 'paginate', resource: @email_conversations, param_name: :conv_page, views_prefix: :ish_manager
71
+
72
+ %br
73
+ = render 'paginate', resource: @email_conversations, param_name: :conv_page, views_prefix: :ish_manager
74
+
@@ -5,7 +5,7 @@
5
5
  <tr>
6
6
 
7
7
  <td valign="top" class="mcnTextContent"
8
- style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
8
+ style="padding-top:0; padding-right:160px; padding-bottom:9px; padding-left:160px;">
9
9
 
10
10
  <em>Copyright © Wasya Co</em><br><br>
11
11
 
@@ -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
17
+ <%= link_to 'update your preferences', '#' %> or
20
18
  <%= link_to 'unsubscribe from this list', @unsubscribe_url %>.<br><br>
21
19
 
22
20
  </td>
@@ -14,7 +14,8 @@
14
14
  <meta charset="UTF-8">
15
15
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
16
16
  <meta name="viewport" content="width=device-width, initial-scale=1">
17
- <title>Wasya Co offers exceptional deployment & development services in nodejs and a variety of other software stacks.</title>
17
+ <title>Wasya Co offers exceptional deployment & development services in nodejs and a variety of other software stacks.
18
+ </title>
18
19
 
19
20
  <style type="text/css">
20
21
  p {
@@ -475,6 +476,7 @@
475
476
  padding-top: 9px;
476
477
  padding-bottom: 9px;
477
478
  }
479
+
478
480
  #templateFooter .mcnTextContent,
479
481
  #templateFooter .mcnTextContent p {
480
482
  color: #656565;
@@ -483,6 +485,7 @@
483
485
  line-height: 150%;
484
486
  text-align: center;
485
487
  }
488
+
486
489
  #templateFooter .mcnTextContent a,
487
490
  #templateFooter .mcnTextContent p a {
488
491
  color: #656565;
@@ -524,7 +527,6 @@
524
527
  width: 100% !important;
525
528
  min-width: 100% !important;
526
529
  }
527
-
528
530
  }
529
531
 
530
532
  @media only screen and (max-width: 480px) {
@@ -538,7 +540,6 @@
538
540
  .mcnImage {
539
541
  width: 100% !important;
540
542
  }
541
-
542
543
  }
543
544
 
544
545
  @media only screen and (max-width: 480px) {
@@ -697,6 +698,13 @@
697
698
 
698
699
  }
699
700
 
701
+ @media only screen and (max-width: 480px) {
702
+ .template-description {
703
+ padding-left: 0 !important;
704
+ padding-right: 0 !important;
705
+ }
706
+ }
707
+
700
708
  @media only screen and (max-width: 480px) {
701
709
 
702
710
  /*
@@ -817,8 +825,7 @@
817
825
  <body>
818
826
  <!--*|IF:MC_PREVIEW_TEXT|*-->
819
827
  <!--[if !gte mso 9]><!----><span class="mcnPreviewText"
820
- style="display:none; font-size:0px; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; visibility:hidden; mso-hide:all;"
821
- >Wasya
828
+ style="display:none; font-size:0px; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; visibility:hidden; mso-hide:all;">Wasya
822
829
  Co offers exceptional deployment & development services in nodejs and a variety of other software stacks.</span>
823
830
  <!--<![endif]-->
824
831
  <!--*|END:IF|*-->
@@ -873,31 +880,132 @@
873
880
  </table>
874
881
  <br /><br />
875
882
 
876
- <table cellpadding="0" cellspacing="0" width="100%">
877
- <tr>
878
- <td align="right">
879
- <img src="https://wasya.co/wp-content/uploads/2023/09/250x250-girl-pointing-1.png"
880
- alt="Good-looking office assistant" />
881
- </td>
882
- <td align="right" valign="top">
883
- <br />
884
- <h1>Ruby on Rails</h1>
885
- <h4><i>Web Application Development</i></h4>
886
883
 
887
- </td>
888
- </tr>
884
+ <!-- 2023-09-23 BEGIN -->
885
+ <table border="0" cellpadding="0" cellspacing="0" width="100%"
886
+ class="templateContainer">
887
+ <tbody>
888
+ <tr>
889
+ <td valign="top">
890
+ <!--[if (gte mso 9)|(IE)]>
891
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
892
+ <tr>
893
+ <td align="center" valign="top" width="300" style="width:300px;">
894
+ <![endif]-->
895
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="300"
896
+ class="columnWrapper">
897
+ <tbody>
898
+ <tr>
899
+ <td valign="top" class="columnContainer">
900
+ <table border="0" cellpadding="0" cellspacing="0" width="100%"
901
+ class="mcnTextBlock" style="min-width:100%;">
902
+ <tbody class="mcnTextBlockOuter">
903
+ <tr>
904
+ <td valign="top" class="mcnTextBlockInner"
905
+ style="padding-top:9px;">
906
+ <!--[if mso]>
907
+ <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100%;">
908
+ <tr>
909
+ <![endif]-->
910
+ <!--[if mso]>
911
+ <td valign="top" width="300" style="width:300px;">
912
+ <![endif]-->
913
+ <table align="left" border="0" cellpadding="0" cellspacing="0"
914
+ style="max-width:100%; min-width:100%;" width="100%"
915
+ class="mcnTextContentContainer">
916
+ <tbody>
917
+ <tr>
918
+ <td valign="top" class="mcnTextContent"
919
+ style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
920
+
921
+ <img src="https://wasya.co/wp-content/uploads/2023/09/250x250-girl-pointing-1.png"
922
+ alt="Good-looking office assistant" /><!-- attractive -->
923
+
924
+ </td>
925
+ </tr>
926
+ </tbody>
927
+ </table>
928
+ <!--[if mso]>
929
+ </td>
930
+ <![endif]-->
931
+ <!--[if mso]>
932
+ </tr>
933
+ </table>
934
+ <![endif]-->
935
+ </td>
936
+ </tr>
937
+ </tbody>
938
+ </table>
939
+ </td>
940
+ </tr>
941
+ </tbody>
942
+ </table>
943
+ <!--[if (gte mso 9)|(IE)]>
944
+ </td>
945
+ <td align="center" valign="top" width="300" style="width:300px;">
946
+ <![endif]-->
947
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="300"
948
+ class="columnWrapper">
949
+ <tbody>
950
+ <tr>
951
+ <td valign="top" class="columnContainer">
952
+ <table border="0" cellpadding="0" cellspacing="0" width="100%"
953
+ class="mcnImageCardBlock">
954
+ <tbody class="mcnImageCardBlockOuter">
955
+ <tr>
956
+ <td class="mcnImageCardBlockInner" valign="top"
957
+ style="padding-top:9px; padding-right:18px; padding-bottom:9px; padding-left:18px;">
958
+ <table align="left" border="0" cellpadding="0" cellspacing="0"
959
+ class="mcnImageCardBottomContent" width="100%" >
960
+ <tbody>
961
+ <tr>
962
+ <td class="mcnImageCardBottomImageContent" align="left"
963
+ valign="top"
964
+ style="padding-top:0px; padding-right:0px; padding-bottom:0; padding-left:0px;">
965
+ <table style="width: 264px;"
966
+ class="mcpreview-image-uploader" data-mc-id="">
967
+ </table>
968
+ </td>
969
+ </tr>
970
+ <tr>
971
+ <td class="mcnTextContent" valign="top"
972
+ style="padding: 9px 18px;color: #F2F2F2;font-family: Helvetica;font-size: 14px;font-weight: normal;text-align: right;"
973
+ width="246">
974
+
975
+ <h1>Ruby on Rails</h1>
976
+ <h4><i>Web Application Development</i></h4>
977
+
978
+ </td>
979
+ </tr>
980
+ </tbody>
981
+ </table>
982
+ </td>
983
+ </tr>
984
+ </tbody>
985
+ </table>
986
+ </td>
987
+ </tr>
988
+ </tbody>
989
+ </table>
990
+ <!--[if (gte mso 9)|(IE)]>
991
+ </td>
992
+ </tr>
993
+ </table>
994
+ <![endif]-->
995
+ </td>
996
+ </tr>
997
+ </tbody>
889
998
  </table>
890
-
891
-
892
-
999
+ <!-- 2023-09-23 END -->
893
1000
 
894
1001
  <br />
895
1002
  <table align="center" border="0" cellpadding="0" cellspacing="0">
896
1003
  <tbody>
897
1004
  <tr>
898
- <td>
899
- <p>Wasya Co offers exceptional deployment & development services <br />
900
- in Ruby on Rails and a variety of other software stacks.</p>
1005
+ <td style="padding-top:0; padding-right:60px; padding-bottom:18px; padding-left:60px;"
1006
+ class='template-description' >
1007
+ <p>Wasya Co offers exceptional deployment & development services
1008
+ in Ruby on Rails and a variety of other software stacks.</p>
901
1009
  </td>
902
1010
  </tr>
903
1011
  </tbody>
@@ -920,9 +1028,10 @@
920
1028
 
921
1029
 
922
1030
  <a class="mcnButton " title="Read More"
923
- href='<%= obfuscate "#{@origin}#{@button_path}?#{@utm_tracking_str}" %>' target="_blank"
924
- style="font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;"
925
- >Learn More</a>
1031
+ href='<%= obfuscate "#{@origin}#{@button_path}?#{@utm_tracking_str}" %>'
1032
+ target="_blank"
1033
+ style="font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;">Learn
1034
+ More</a>
926
1035
  </td>
927
1036
  </tr>
928
1037
  </tbody>
@@ -960,7 +1069,7 @@
960
1069
  <tr>
961
1070
  <td align="center" valign="top" style="padding:9px" class="mcnFollowBlockInner">
962
1071
 
963
- <%= render 'footer_unsubscribe' %>
1072
+ <%= render 'ish_manager/email_templates/footer_unsubscribe' %>
964
1073
 
965
1074
  </td>
966
1075
  </tr>
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', as: :email_conversation
90
+ get 'email_conversations/show/:id', to: 'email_conversations#show', as: :email_conversation
91
91
 
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
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/send/:id', to: 'email_contexts#do_send', as: :send_email_context
97
- get 'email_contexts', to: 'email_contexts#index', as: :email_contexts
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
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.470
4
+ version: 0.1.8.472
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-22 00:00:00.000000000 Z
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
@@ -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