wco_email 0.1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +7 -0
  2. data/README.txt +129 -0
  3. data/Rakefile +5 -0
  4. data/app/assets/config/wco_email_manifest.js +7 -0
  5. data/app/assets/javascript/vendor-trash/jquery-ui.min.js +13 -0
  6. data/app/assets/javascript/vendor-trash/jquery.fileupload.js +1482 -0
  7. data/app/assets/javascript/vendor-trash/jquery.iframe-transport.js +224 -0
  8. data/app/assets/javascript/vendor-trash/jquery.ui.widget.js +572 -0
  9. data/app/assets/javascript/vendor-trash/summernote-bs4.min.js +3 -0
  10. data/app/assets/javascript/wco_email/application.js +11 -0
  11. data/app/assets/javascript/wco_email/contexts.js +19 -0
  12. data/app/assets/javascript/wco_email/conversations.js +177 -0
  13. data/app/assets/javascript/wco_email/file_upload.js-trash +32 -0
  14. data/app/assets/javascript/wco_email/shared.js +22 -0
  15. data/app/assets/stylesheets/wco_email/application.scss +29 -0
  16. data/app/assets/stylesheets/wco_email/contexts.scss +63 -0
  17. data/app/assets/stylesheets/wco_email/conversations.scss +16 -0
  18. data/app/assets/stylesheets/wco_email/tags.scss +6 -0
  19. data/app/controllers/wco_email/application_controller.rb +16 -0
  20. data/app/controllers/wco_email/contexts_controller.rb +156 -0
  21. data/app/controllers/wco_email/conversations_controller.rb +129 -0
  22. data/app/controllers/wco_email/email_action_templates_controller.rb +77 -0
  23. data/app/controllers/wco_email/email_actions_controller.rb +55 -0
  24. data/app/controllers/wco_email/email_campaigns_controller.rb +73 -0
  25. data/app/controllers/wco_email/email_filters_controller.rb +72 -0
  26. data/app/controllers/wco_email/email_layouts_controller.rb +13 -0
  27. data/app/controllers/wco_email/email_templates_controller.rb +124 -0
  28. data/app/controllers/wco_email/message_stubs_controller.rb +14 -0
  29. data/app/controllers/wco_email/messages_controller.rb +28 -0
  30. data/app/controllers/wco_email/obfuscated_redirects_controller.rb +20 -0
  31. data/app/controllers/wco_email/sessions_controller.rb +19 -0
  32. data/app/controllers/wco_email/unsubscribes_controller.rb +40 -0
  33. data/app/helpers/wco_email/application_helper.rb +20 -0
  34. data/app/jobs/wco_email/message_intake_job.rb +54 -0
  35. data/app/mailers/wco_email/application_mailer.rb +98 -0
  36. data/app/views/202212 Mailchimp Templates/202212 1col fixed-width.html +863 -0
  37. data/app/views/202212 Mailchimp Templates/202212 1col full-width.html +906 -0
  38. data/app/views/202212 Mailchimp Templates/202212 2col fixed-width 2.html +1003 -0
  39. data/app/views/202212 Mailchimp Templates/202212 2col fixed-width.html +1082 -0
  40. data/app/views/202212 Mailchimp Templates/202212 2col full-width 2.html +1053 -0
  41. data/app/views/202212 Mailchimp Templates/202212 2col full-width.html +1147 -0
  42. data/app/views/202212 Mailchimp Templates/202212 3col fixed-width.html +1087 -0
  43. data/app/views/202212 Mailchimp Templates/202212 3col full-width.html +1136 -0
  44. data/app/views/202212 Mailchimp Templates/202212 catalog various-colors-1.html +1223 -0
  45. data/app/views/202212 Mailchimp Templates/202212 educate.html +1080 -0
  46. data/app/views/202212 Mailchimp Templates/202212 follow up.html +1001 -0
  47. data/app/views/202212 Mailchimp Templates/202212 make an announcement.html +1048 -0
  48. data/app/views/202212 Mailchimp Templates/202212 sell-a-product.html +977 -0
  49. data/app/views/202212 Mailchimp Templates/202212 tell a story.html +1168 -0
  50. data/app/views/202212 Mailchimp Templates/202212 theme art-newsletter.html +1612 -0
  51. data/app/views/202212 Mailchimp Templates/202212 theme caribou-xmas.html +856 -0
  52. data/app/views/202212 Mailchimp Templates/202212 theme colorbox.html +1027 -0
  53. data/app/views/202212 Mailchimp Templates/202212 theme competition-invitation.html +918 -0
  54. data/app/views/202212 Mailchimp Templates/202212 theme event-veerle.html +1132 -0
  55. data/app/views/202212 Mailchimp Templates/202212 theme fall-colors.html +1407 -0
  56. data/app/views/202212 Mailchimp Templates/202212 theme gift-giving.html +787 -0
  57. data/app/views/202212 Mailchimp Templates/202212 theme giftgiving-snowmen.html +731 -0
  58. data/app/views/202212 Mailchimp Templates/202212 theme heart-of-flowers.html +795 -0
  59. data/app/views/202212 Mailchimp Templates/202212 theme hero-card.html +915 -0
  60. data/app/views/202212 Mailchimp Templates/202212 theme hero-image.html +1148 -0
  61. data/app/views/202212 Mailchimp Templates/202212 theme monthly-contest.html +967 -0
  62. data/app/views/202212 Mailchimp Templates/202212 theme multiple-event.html +1189 -0
  63. data/app/views/202212 Mailchimp Templates/202212 theme postcard.html +914 -0
  64. data/app/views/202212 Mailchimp Templates/202212 theme snowy-fields.html +733 -0
  65. data/app/views/202212 Mailchimp Templates/202212 theme soft.html +849 -0
  66. data/app/views/202212 Mailchimp Templates/202212 theme sophisticated.html +1079 -0
  67. data/app/views/202212 Mailchimp Templates/202212 theme subtle.html +1218 -0
  68. data/app/views/202212 Mailchimp Templates/202212 theme ticket.html +1015 -0
  69. data/app/views/202212 Mailchimp Templates/202212 theme whale.html +888 -0
  70. data/app/views/202310 Email Templates/_acknowledgement_of_document_receipt.html.erb +23 -0
  71. data/app/views/202310 Email Templates/_support_ticket_created.html.erb +26 -0
  72. data/app/views/layouts/wco_email/application.haml +64 -0
  73. data/app/views/layouts/wco_email/mailbox.haml-trash +62 -0
  74. data/app/views/wco_email/_analytics.erb +16 -0
  75. data/app/views/wco_email/_main_header.haml +31 -0
  76. data/app/views/wco_email/_sidebar.haml +10 -0
  77. data/app/views/wco_email/application_mailer/_footer_unsubscribe.html.erb +24 -0
  78. data/app/views/wco_email/application_mailer/_header_logo.html.erb +12 -0
  79. data/app/views/wco_email/application_mailer/forwarder_notify.html.erb +17 -0
  80. data/app/views/wco_email/contexts/_form.haml +59 -0
  81. data/app/views/wco_email/contexts/_form_reply.haml +27 -0
  82. data/app/views/wco_email/contexts/_header.haml +22 -0
  83. data/app/views/wco_email/contexts/_index.haml +8 -0
  84. data/app/views/wco_email/contexts/edit.haml +8 -0
  85. data/app/views/wco_email/contexts/iframe_src.haml +3 -0
  86. data/app/views/wco_email/contexts/index.haml +51 -0
  87. data/app/views/wco_email/contexts/new.haml +5 -0
  88. data/app/views/wco_email/contexts/show.haml +34 -0
  89. data/app/views/wco_email/contexts/summary.csv.erb +4 -0
  90. data/app/views/wco_email/contexts/summary.haml +16 -0
  91. data/app/views/wco_email/conversations/_actions.haml +21 -0
  92. data/app/views/wco_email/conversations/_search.haml +14 -0
  93. data/app/views/wco_email/conversations/index.haml +43 -0
  94. data/app/views/wco_email/conversations/show.haml +27 -0
  95. data/app/views/wco_email/email_action_templates/_form.haml +45 -0
  96. data/app/views/wco_email/email_action_templates/_header.haml +8 -0
  97. data/app/views/wco_email/email_action_templates/edit.haml +7 -0
  98. data/app/views/wco_email/email_action_templates/index.haml +36 -0
  99. data/app/views/wco_email/email_action_templates/new.haml +9 -0
  100. data/app/views/wco_email/email_action_templates/show.haml +11 -0
  101. data/app/views/wco_email/email_actions/_form.haml +24 -0
  102. data/app/views/wco_email/email_actions/_form_mini.haml-trash +28 -0
  103. data/app/views/wco_email/email_actions/_header.haml +8 -0
  104. data/app/views/wco_email/email_actions/edit.haml +4 -0
  105. data/app/views/wco_email/email_actions/index.haml +31 -0
  106. data/app/views/wco_email/email_actions/new.haml +4 -0
  107. data/app/views/wco_email/email_actions/show.haml +0 -0
  108. data/app/views/wco_email/email_campaigns/_form.haml +33 -0
  109. data/app/views/wco_email/email_campaigns/_header.haml +5 -0
  110. data/app/views/wco_email/email_campaigns/edit.haml +5 -0
  111. data/app/views/wco_email/email_campaigns/index.haml +14 -0
  112. data/app/views/wco_email/email_campaigns/new.haml +5 -0
  113. data/app/views/wco_email/email_campaigns/show.haml +17 -0
  114. data/app/views/wco_email/email_filters/_form.haml +40 -0
  115. data/app/views/wco_email/email_filters/_header.haml +5 -0
  116. data/app/views/wco_email/email_filters/edit.haml +5 -0
  117. data/app/views/wco_email/email_filters/index.haml +48 -0
  118. data/app/views/wco_email/email_filters/new.haml +5 -0
  119. data/app/views/wco_email/email_templates/_form.haml +48 -0
  120. data/app/views/wco_email/email_templates/_form_mini.haml +9 -0
  121. data/app/views/wco_email/email_templates/_form_reply_mini.haml +8 -0
  122. data/app/views/wco_email/email_templates/_form_schedule_mini.haml +11 -0
  123. data/app/views/wco_email/email_templates/_header.haml +6 -0
  124. data/app/views/wco_email/email_templates/_index.haml +26 -0
  125. data/app/views/wco_email/email_templates/_index_expanded.haml +13 -0
  126. data/app/views/wco_email/email_templates/_m20221201react.html.erb +1202 -0
  127. data/app/views/wco_email/email_templates/_m20221222merryxmas.html.erb +766 -0
  128. data/app/views/wco_email/email_templates/_m202309_feedback.html.erb +1161 -0
  129. data/app/views/wco_email/email_templates/_m202309_ror4.html.erb +1068 -0
  130. data/app/views/wco_email/email_templates/_marketing_node_1.html.erb +984 -0
  131. data/app/views/wco_email/email_templates/_marketing_react_1.html +0 -0
  132. data/app/views/wco_email/email_templates/_marketing_react_2.html.erb +749 -0
  133. data/app/views/wco_email/email_templates/_marketing_react_3.html.erb +628 -0
  134. data/app/views/wco_email/email_templates/_marketing_ror_1.html +751 -0
  135. data/app/views/wco_email/email_templates/_marketing_ror_2.html.erb +755 -0
  136. data/app/views/wco_email/email_templates/_marketing_ror_3.html.erb +25 -0
  137. data/app/views/wco_email/email_templates/_marketing_ror_4.html.erb +25 -0
  138. data/app/views/wco_email/email_templates/_marketing_ror_5.html.erb +17 -0
  139. data/app/views/wco_email/email_templates/_marketing_wordpress_1.html +0 -0
  140. data/app/views/wco_email/email_templates/_marketing_wordpress_2.html +0 -0
  141. data/app/views/wco_email/email_templates/_meta.haml +6 -0
  142. data/app/views/wco_email/email_templates/_piousbox_roundborders.html.erb +1007 -0
  143. data/app/views/wco_email/email_templates/_piousbox_social.html.erb +181 -0
  144. data/app/views/wco_email/email_templates/_plain.haml +15 -0
  145. data/app/views/wco_email/email_templates/_rec_resume_shared_with_you.html.erb +39 -0
  146. data/app/views/wco_email/email_templates/_slug-1.html.erb +0 -0
  147. data/app/views/wco_email/email_templates/_slug-2.html.erb +0 -0
  148. data/app/views/wco_email/email_templates/_slug-3.html.erb +0 -0
  149. data/app/views/wco_email/email_templates/_tracking_footer.html.erb +13 -0
  150. data/app/views/wco_email/email_templates/_wasyaco_roundborders.html.erb +686 -0
  151. data/app/views/wco_email/email_templates/_wasyaco_social.html.erb +181 -0
  152. data/app/views/wco_email/email_templates/edit.haml +6 -0
  153. data/app/views/wco_email/email_templates/new.haml +6 -0
  154. data/app/views/wco_email/email_templates/show.haml +11 -0
  155. data/app/views/wco_email/email_templates/show_iframe.haml +2 -0
  156. data/app/views/wco_email/lead_action_templates/_header.haml +7 -0
  157. data/app/views/wco_email/lead_actions/_header.haml +8 -0
  158. data/app/views/wco_email/message_stubs/_index.haml +10 -0
  159. data/app/views/wco_email/messages/_form_reply.haml-trash +17 -0
  160. data/app/views/wco_email/messages/_meta.haml +30 -0
  161. data/app/views/wco_email/messages/show.haml +13 -0
  162. data/app/views/wco_email/messages/show_iframe.haml +5 -0
  163. data/app/views/wco_email/sessions/new.html.erb +4 -0
  164. data/app/views/wco_email/unsubscribes/_header.haml +4 -0
  165. data/app/views/wco_email/unsubscribes/_table.haml +22 -0
  166. data/config/initializers/assets.rb +10 -0
  167. data/config/routes.rb +49 -0
  168. data/lib/tasks/bjjcollective/sitemap.rb +50 -0
  169. data/lib/tasks/db_tasks.rake +12 -0
  170. data/lib/tasks/direct_mail_tasks.rake +35 -0
  171. data/lib/tasks/infinite_shelter/sitemap.rb +25 -0
  172. data/lib/tasks/piousbox/sitemap.rb +80 -0
  173. data/lib/tasks/publish2_wordpress_tasks.rake +54 -0
  174. data/lib/tasks/scrape_reddit_tasks.rake-bk +23 -0
  175. data/lib/tasks/trash/email_tasks.rake-trash +126 -0
  176. data/lib/tasks/trash/sitemap_tasks.rake-trash +146 -0
  177. data/lib/tasks/wasya_co/sitemap.rb +281 -0
  178. data/lib/tasks/wco_email_tasks.rake +117 -0
  179. data/lib/wco_email/README_email_actions.rb +7 -0
  180. data/lib/wco_email/README_email_contexts.rb +7 -0
  181. data/lib/wco_email/engine.rb +8 -0
  182. data/lib/wco_email.rb +19 -0
  183. metadata +493 -0
@@ -0,0 +1,27 @@
1
+
2
+ - content_for :sidebar do
3
+ = render 'wco_email/sidebar'
4
+
5
+ .conversations-show.maxwidth
6
+ %h5
7
+ = @conversation.subject
8
+ <b>(#{@conversation.messages.length})</b>
9
+ %span.gray.mini= @conversation.id
10
+
11
+
12
+ - if @other_convs.present?
13
+ - @other_convs.each do |conv|
14
+ .d-flex
15
+ = button_to "Merge", merge_email_conversations_path( @conversation, conv ), data: { confirm: 'Are you sure?' }
16
+ = conv.subject
17
+ (#{conv.messages.length})
18
+ %span.gray.mini= conv.id
19
+
20
+
21
+ %ul.m-0.p-0
22
+ - @conversation.messages.each do |msg|
23
+ %li
24
+ = render '/wco_email/messages/meta', message: msg
25
+ %iframe.message-iframe{ src: message_iframe_path(msg) }
26
+
27
+ = render '/wco_email/contexts/form_reply', lead_id: msg.lead_id, message: msg, ctx: WcoEmail::Context.new({ from_email: msg.to.downcase, subject: msg.subject })
@@ -0,0 +1,45 @@
1
+
2
+ - eact = email_action
3
+ - url = email_action.new_record? ? email_actions_path : email_action_path( email_action )
4
+
5
+ .email-actions--form
6
+
7
+ = form_for email_action, url: url, as: :email_action, :html => { :multipart => true } do |f|
8
+ .row
9
+ .col-sm-6
10
+ = f.submit :submit
11
+
12
+ .row
13
+ .col-md-6
14
+ .field
15
+ %label Slug
16
+ = f.text_field :slug
17
+ -# .field
18
+ -# %label Descr
19
+ -# = f.text_area :descr
20
+ .field.flex-row
21
+ %label Template
22
+ = f.select :email_template_id, options_for_select( @email_templates_list, selected: eact.email_template_id ), {}, class: 'select2'
23
+
24
+ .col-md-6
25
+ .field
26
+ %label Next Email Actions
27
+ .eg rand(1..5).business_days.from_now.to_date + rand(8..16).hours + rand(1..59).minutes
28
+ .eg This is not an interval! But you can do Time.now + 30.seconds
29
+ %br
30
+
31
+ = f.fields_for :ties do |next_f|
32
+ .flex-row.field
33
+ = next_f.label :next_at_exe
34
+ = next_f.text_field :next_at_exe, class: 'flex-grow'
35
+ .flex-row.field
36
+ = next_f.label :to_delete
37
+ = next_f.check_box :to_delete
38
+ = next_f.select :next_email_action_id, options_for_select( @email_actions_list, selected: next_f.object.next_email_action_id ), { }, { class: 'select2' }
39
+ %br
40
+
41
+ .row
42
+ .col-sm-6
43
+ = f.submit :submit
44
+
45
+
@@ -0,0 +1,8 @@
1
+
2
+
3
+ = link_to "Email Action Tmpls (#{WcoEmail::EmailActionTemplate.all.length})", email_action_templates_path
4
+ .inline-search
5
+ = form_tag email_action_templates_path, method: :get do
6
+ = text_field_tag :q
7
+ = link_to '[+]', new_email_action_template_path
8
+
@@ -0,0 +1,7 @@
1
+
2
+ .email-actions-edit.padded
3
+ .header
4
+ %h2.title Edit Email Action
5
+
6
+ = render 'form', email_action: @act
7
+
@@ -0,0 +1,36 @@
1
+
2
+ .email-actions-index.padded
3
+
4
+ .header
5
+ %h2.title
6
+ Email Actions (#{@email_actions.length})
7
+ = link_to '[+]', new_email_action_path
8
+
9
+ %table.bordered
10
+ %tr
11
+ %th= check_box_tag 'abba'
12
+ %th
13
+ %th slug
14
+ %th next actions
15
+ - @email_actions.each do |eact|
16
+ %tr
17
+ %td= check_box_tag 'abba'
18
+ %td.flex-row
19
+
20
+ = link_to '[~]', edit_email_action_path( eact )
21
+ = button_to '[x]', email_action_path( eact ), data: { confirm: 'Are you sure?' }, method: :delete
22
+
23
+ %td
24
+ -# = link_to eact.slug, email_action_path( eact )
25
+ = eact.slug
26
+ .em.small= eact.descr
27
+ %td
28
+ %ul
29
+ - eact.ties.map do |next_a|
30
+ %li
31
+ .a= next_a.next_at_exe
32
+ .a
33
+ - if next_a.next_email_action.slug == eact.slug
34
+ (same)
35
+ = next_a.next_email_action.slug
36
+
@@ -0,0 +1,9 @@
1
+
2
+ -# padded b/c eval(next_time_at) is long
3
+
4
+ .email-actions-new.padded
5
+ .header
6
+ %h2.title
7
+ New Email Action
8
+
9
+ = render 'form', email_action: @new_email_action
@@ -0,0 +1,11 @@
1
+
2
+ .email-actions-show.maxwidth
3
+ .header
4
+ .title Email Action #{@act.id}
5
+
6
+ %ul
7
+ - @act.ties.map do |next_a|
8
+ %li
9
+ .a <b>Next act:</b> #{"(same)" if next_a.next_email_action.slug == @act.slug} #{next_a.next_email_action.slug}
10
+ .a <b>Next at exe:</b> #{next_a.next_at_exe}
11
+ .a <b>Eval'ed:</b> #{eval( next_a.next_at_exe )}
@@ -0,0 +1,24 @@
1
+
2
+ - sch_a = scheduled_email_action
3
+ - url = sch_a.new_record? ? scheduled_email_actions_path : scheduled_email_action_path(sch_a.id)
4
+
5
+ .scheduled-email-actions--form
6
+ = form_for scheduled_email_action, url: url, as: :sch do |f|
7
+ .header
8
+ %h5.title Schedule an email action
9
+
10
+ .flex-row
11
+ = f.label :lead
12
+ = f.select :lead_id, options_for_select(@leads_list, selected: sch_a[:lead_id]||params[:lead_id] ), {}, class: 'select2'
13
+ .flex-row
14
+ %label State
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
20
+ = f.label :perform_at
21
+ = f.text_field :perform_at, value: sch_a.new_record? ? Time.now : sch_a.perform_at
22
+
23
+ .actions
24
+ = submit_tag 'Schedule'
@@ -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'
@@ -0,0 +1,8 @@
1
+
2
+
3
+
4
+ = link_to "Email Actions (#{WcoEmail::EmailAction.all.length})", email_actions_path
5
+ .inline-search
6
+ = form_tag email_actions_path, method: :get do
7
+ = text_field_tag :q
8
+ = link_to '[+]', new_email_action_path
@@ -0,0 +1,4 @@
1
+
2
+ .scheduled-email-actions-edit.maxwidth
3
+
4
+ = render 'form', scheduled_email_action: @sch
@@ -0,0 +1,31 @@
1
+
2
+ .email-actions-index.padded
3
+ .header
4
+ %h2
5
+ Email Actions
6
+ (#{Sch.all.count})
7
+ = link_to '[+]', new_email_action_path
8
+
9
+ %table.bordered.data-table
10
+ %thead
11
+ %tr
12
+ %td
13
+ %td Active?
14
+ %td From
15
+ %td To
16
+ %td Tmpl
17
+ %td Perform at
18
+ %tbody
19
+ - @schs.each do |sch|
20
+ %tr
21
+ %td= link_to '[~]', edit_email_action_path(sch)
22
+ %td= sch.status == 'active' ? 'Y' : '-'
23
+ %td= sch.tmpl.from_email
24
+ %td= link_to sch.lead.email, lead_path(sch.lead)
25
+ %td= link_to sch.tmpl.email_template.slug, email_template_path(sch.tmpl.email_template)
26
+ %td= sch.perform_at.in_time_zone
27
+
28
+
29
+
30
+
31
+
@@ -0,0 +1,4 @@
1
+
2
+ .scheduled-email-actions-new.maxwidth
3
+
4
+ = render 'form', scheduled_email_action: @scheduled_email_action
File without changes
@@ -0,0 +1,33 @@
1
+
2
+ - url = campaign.new_record? ? email_campaigns_path : email_campaign_path(campaign)
3
+
4
+ .email-campaigns--form
5
+ = form_for campaign, as: :campaign, url: url do |f|
6
+ .field
7
+ = f.label :slug
8
+ = f.text_field :slug
9
+
10
+ -# .field
11
+ -# = f.label :send_at
12
+ -# = f.text_field :send_at
13
+
14
+ .field.field-template
15
+ = f.label "Template"
16
+ = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || campaign.email_template_id ), {}, { class: 'select2' }
17
+ - if campaign.email_template_id
18
+ = link_to 'view', email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
19
+ = link_to '~', edit_email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
20
+ layout: #{campaign.tmpl.layout}
21
+
22
+ .field
23
+ = f.label "From"
24
+ = f.select :from_email, options_for_select(WcoEmail::EmailTemplate.from_emails_list, selected: campaign.from_email), {}, class: 'select2'
25
+
26
+ .actions
27
+ = f.submit 'Submit'
28
+
29
+ -# = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || campaign.email_template_id ), {}, { class: 'select2' }
30
+ -# - if campaign.email_template_id
31
+ -# = link_to 'view', email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
32
+ -# = link_to '~', edit_email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
33
+ -# layout: #{campaign.tmpl.layout}
@@ -0,0 +1,5 @@
1
+
2
+ = link_to "Email Campaigns (#{WcoEmail::Campaign.all.length})", email_campaigns_path
3
+ = form_tag email_campaigns_path, method: :get do
4
+ = text_field_tag :q
5
+ = link_to '[+]', new_email_campaign_path
@@ -0,0 +1,5 @@
1
+
2
+ .email-campaigns-new.maxwidth
3
+ .header
4
+ %h3.title Edit Email Campaign
5
+ = render 'form', campaign: @campaign
@@ -0,0 +1,14 @@
1
+
2
+ .email-campaigns-index.maxwidth
3
+ .header
4
+ %h5.title
5
+ Email Campaigns (#{@campaigns.length})
6
+ = link_to '[+]', new_email_campaign_path
7
+
8
+ %ul
9
+ - @campaigns.each do |c|
10
+ %li
11
+ = link_to c.slug, email_campaign_path(c)
12
+ (#{c.leads.length})
13
+ = link_to '[~]', edit_email_campaign_path(c)
14
+
@@ -0,0 +1,5 @@
1
+
2
+ .email-campaigns-new.maxwidth
3
+ .header
4
+ %h3.title New Email Campaign
5
+ = render 'form', campaign: @campaign
@@ -0,0 +1,17 @@
1
+
2
+ .email-campaigns-show.maxwidth
3
+ .header
4
+ %h5.title
5
+ Email Campaign `#{@campaign.slug}`
6
+ = link_to '[~]', edit_email_campaign_path(@campaign)
7
+ .inline-block
8
+ = form_for @campaign, as: :campaign, method: :post, url: send_email_campaign_path(@campaign) do |f|
9
+ = hidden_field_tag 'campaign[send_at]', Time.now
10
+ = f.submit 'Send', data: { confirm: 'Are you sure?' }
11
+
12
+ %ul.browser-default
13
+ %li Template: #{link_to @campaign.email_template.slug, edit_email_template_path(@campaign.email_template)}
14
+ -# %li Send At: #{@campaign.send_at}
15
+
16
+ .collapse-expand#campaignLeads Email Campaign leads (#{@campaign.campaign_leads.length})
17
+ = render 'ish_manager/leads/index', leads: @leads, search_path: email_campaign_path(@campaign), email_contexts: {}
@@ -0,0 +1,40 @@
1
+
2
+ - url = email_filter.new_record? ? email_filters_path : email_filter_path( email_filter )
3
+ .email-filters--from
4
+ = form_for email_filter, url: url, as: :email_filter do |f|
5
+ .row.maxwidth
6
+ .col-md-6
7
+ .field
8
+ %label From Regex
9
+ = f.text_field :from_regex
10
+ .field
11
+ %label From Exact
12
+ = f.text_field :from_exact
13
+ .field
14
+ %label Subject Regex
15
+ = f.text_field :subject_regex
16
+ .field
17
+ %label Subject Exact
18
+ = f.text_field :subject_exact
19
+ -# .field
20
+ -# %label Body Regex
21
+ -# = f.text_field :body_regex
22
+ .field
23
+ %label Body Exact
24
+ = f.text_field :body_exact
25
+ .col-md-6
26
+
27
+ .field
28
+ %label Kind
29
+ = f.select :kind, options_for_select( WcoEmail::EmailFilter::KINDS, selected: email_filter.kind )
30
+ .field
31
+ %label Template
32
+ = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || email_filter.email_template_id ), {}, { class: 'select2' }
33
+ .field
34
+ = f.label :email_action_template
35
+ = f.select :email_action_template, options_for_select( @email_action_templates_list, selected: email_filter.email_action_template ), {}, class: 'select2'
36
+ -# .field
37
+ -# = f.label :wp_term_id
38
+ -# = f.select :wp_term_id, options_for_select( @email_tags_list, selected: email_filter.wp_term_id ), {}, class: 'select2'
39
+ .actions
40
+ = f.submit
@@ -0,0 +1,5 @@
1
+
2
+ = link_to "Email Filters (#{WcoEmail::EmailFilter.all.length})", email_filters_path
3
+ = form_tag email_filters_path, method: :get do
4
+ = text_field_tag :q
5
+ = link_to '[+]', new_email_filter_path
@@ -0,0 +1,5 @@
1
+
2
+ .emails-ns.email-filters-edit.maxwidth
3
+ .header
4
+ %h2.title Edit Email Filter
5
+ = render 'form', email_filter: @email_filter
@@ -0,0 +1,48 @@
1
+
2
+ .email-filters-index.padded
3
+ .header
4
+ %h2.title
5
+ Email Filters (#{@email_filters.length})
6
+ = link_to '[+]', new_email_filter_path
7
+
8
+
9
+ .maxwidth
10
+ %hr
11
+ %h5.title.collapse-expand#newEmailFilter New Email Filter
12
+ = render 'form', email_filter: @email_filter
13
+ %hr
14
+
15
+ %table.bordered.data-table
16
+ %thead
17
+ %tr
18
+ %th &nbsp;
19
+ %th &nbsp;
20
+ %th From Regex
21
+ %th From Exact
22
+ %th Subject Regex
23
+ %th Subject Exact
24
+ %th Body Exact
25
+ %th Kind
26
+ %th Email Action
27
+ %th Email Template
28
+ %th Email Tag
29
+ - @email_filters.each do |ef|
30
+
31
+ %tr
32
+ %td= check_box_tag 'checked'
33
+ %td
34
+ = link_to '[~]', edit_email_filter_path(ef)
35
+ .inline-block= button_to '[x]', email_filter_path(ef), method: :delete, data: { confirm: 'Are you sure?' }
36
+ %td
37
+ `#{ef.from_regex}`
38
+ %td
39
+ `#{ef.from_exact}`
40
+ %td= ef.subject_regex
41
+ %td= ef.subject_exact
42
+ %td= ef.body_exact
43
+ %td= ef.kind
44
+ %td= ef.email_action&.slug
45
+ %td= ef.email_template&.slug
46
+ %td= ef.category&.name
47
+
48
+
@@ -0,0 +1,5 @@
1
+
2
+ .emails-ns.email-filters-new.maxwidth
3
+ .header
4
+ %h2.title New Email Filter
5
+ = render 'form', email_filter: @email_filter
@@ -0,0 +1,48 @@
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, as: :template, url: url do |f|
6
+ .field
7
+ %label Slug
8
+ = f.text_field :slug
9
+ .flex-row
10
+ %label Layout
11
+ = f.select :layout, options_for_select(WcoEmail::EmailTemplate::LAYOUTS, selected: email_template.layout), {}, class: 'select2'
12
+ %label From
13
+ = f.select :from_email, options_for_select(WcoEmail::EmailTemplate.from_emails_list, selected: email_template.from_email), {}, class: 'select2'
14
+ .field.field-subject
15
+ = f.label :subject
16
+ = f.text_field :subject
17
+ .field
18
+ = f.label :preview_str
19
+ = f.text_field :preview_str
20
+ -# .field
21
+ -# = f.label :can_unsubscribe
22
+ -# = f.check_box :can_unsubscribe
23
+
24
+
25
+ .tab-labels.flex-row
26
+ %a.label-raw{ href: "javascript: void(0)", data: { ref: '.tab-raw' } } Raw
27
+ %a.label-preview.active{ href: "javascript: void(0)", data: { ref: '.tab-preview' } } Preview
28
+ .label-save-preview= f.submit 'Save & Preview'
29
+ .tabs
30
+ .tab-raw
31
+ = f.text_area :body # , class: 'tinymce'
32
+ .tab-preview
33
+ - if email_template.persisted?
34
+ %iframe{ src: email_template_iframe_path(email_template), width: '100%', height: '100%' }
35
+
36
+ .row
37
+ .col-md-6
38
+ .field
39
+ = f.label :config_json
40
+ = f.text_area :config_json
41
+ .col-md-6
42
+ .field
43
+ = f.label :config_exe
44
+ = f.text_area :config_exe
45
+
46
+ .actions
47
+ = f.submit 'Save'
48
+
@@ -0,0 +1,9 @@
1
+
2
+ .email-templates--form-mini
3
+ = form_for ::Ish::EmailTemplate.new, url: email_templates_path do |f|
4
+ %h3 New Email Template
5
+ .field
6
+ = f.label :slug
7
+ = f.text_field :slug
8
+ .actions
9
+ = f.submit 'Create'
@@ -0,0 +1,8 @@
1
+
2
+ .email-templates--form-reply-mini.form-mini
3
+ = form_for ::Ish::EmailContext.new, url: email_contexts_path do |f|
4
+ .field
5
+ -# = f.label :template
6
+ = f.select :email_template_id, options_for_select( @email_templates_list )
7
+ .actions
8
+ = f.submit 'Reply'
@@ -0,0 +1,11 @@
1
+
2
+ .email-templates--form-schedule-mini.form-mini
3
+ = form_for ::Ish::EmailContext.new, url: email_contexts_path do |f|
4
+ .field
5
+ -# = f.label :template
6
+ = f.select :email_template_id, options_for_select([ ['abba', 'abba'], ['zetta', 'zetta'] ])
7
+ .field.send-at
8
+ -# = f.label :send_at
9
+ = f.text_field :send_at, placeholder: 'YYYY-MM-DD'
10
+ .actions
11
+ = f.submit 'Schedule'
@@ -0,0 +1,6 @@
1
+
2
+ = link_to "Email Templates (#{WcoEmail::EmailTemplate.all.count})", email_templates_path
3
+ = form_tag email_templates_path, method: :get do
4
+ = text_field_tag :q
5
+ = link_to '[+]', new_email_template_path
6
+ = link_to '[expanded]', email_templates_path({ template: '_index_expanded' })
@@ -0,0 +1,26 @@
1
+
2
+ .email-templates--index.maxwidth
3
+
4
+ %h5.flex-row.collapse-expand#emailTemplatesIndex
5
+ = render '/wco_email/email_templates/header'
6
+
7
+ = paginate @templates, :param_name => :templates_page, :views_prefix => 'wco'
8
+ .email-templates-index.maxwidth
9
+ %table.bordered.data-table
10
+ %thead
11
+ %tr
12
+ %th &nbsp;
13
+ %th Slug
14
+ %th Created
15
+ %th Updated
16
+
17
+ - @templates.each do |tmpl|
18
+ %tr
19
+ %td.flex-row
20
+ = link_to '[use]', new_context_path({ email_template_id: tmpl.id })
21
+ = link_to '[~]', edit_email_template_path({ id: tmpl })
22
+ = button_to '[x]', email_template_path({ id: tmpl }), method: :delete, :data => { :confirm => 'Are you sure?' }, form_class: 'inline'
23
+ %td= link_to tmpl.slug, email_template_path({ id: tmpl })
24
+ %td= pp_date tmpl.created_at
25
+ %td= pp_date tmpl.updated_at
26
+ = paginate @templates, :param_name => :templates_page, :views_prefix => 'wco'
@@ -0,0 +1,13 @@
1
+
2
+ .email-templates--index-expanded.padded
3
+
4
+ %h5.flex-row.collapse-expand#emailTemplatesIndex
5
+ = render '/wco_email/email_templates/header'
6
+
7
+ = paginate @templates, :param_name => :templates_page, :views_prefix => 'wco'
8
+ .row
9
+ - @templates.each do |tmpl|
10
+ .col-md-6
11
+ %iframe.email-template-iframe{ src: email_template_iframe_path(tmpl) }
12
+ = render '/wco_email/email_templates/meta', tmpl: tmpl
13
+ = paginate @templates, :param_name => :templates_page, :views_prefix => 'wco'