wco_email 0.1.1.134 → 0.1.1.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascript/wco_email/contexts.js +8 -1
- data/app/controllers/wco_email/api/conversations_controller.rb +7 -0
- data/app/controllers/wco_email/messages_controller.rb +29 -0
- data/app/views/wco_email/contexts/_form.haml +1 -1
- data/app/views/wco_email/conversations/index.haml +5 -0
- data/app/views/wco_email/conversations/show.haml +2 -1
- data/config/initializers/08_integrations.rb +2 -0
- data/config/routes.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c920c0ce8ae8d6be19d6082a242f6d9d61ede4b85bfcdca7a680cca133abcf49
|
|
4
|
+
data.tar.gz: 3cf6dbdf328d8b996ed111df5ad3e7880b4704439ac5be41783d36e4dcd17185
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41f0243a85a81ca840c9c20d8926e84fe02cdc3b6fad8218c6ea0145e50538fe157e55a9491d9fda3fa9a425c65d52e3330299c9fe4435fdbc453f6abd3ccee6
|
|
7
|
+
data.tar.gz: d323ddf5c01c912a42a2c272a949fdaadc2548e51a3f65a570ce2757bcb07d16c1313c68a096fa376a0fd6e633737a7499d025bfdfa8e081ea7ca739e8cda67b
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
class WcoEmail::Api::ConversationsController < WcoEmail::ApiController
|
|
3
3
|
|
|
4
|
+
def destroy_many
|
|
5
|
+
authorize! :edit, WcoEmail::Conversation
|
|
6
|
+
@convs = WcoEmail::Conversation.find( params[:ids] )
|
|
7
|
+
@convs.each { |c| c.destroy! }
|
|
8
|
+
render json: { status: 'ok', message: 'probably ok' }
|
|
9
|
+
end
|
|
10
|
+
|
|
4
11
|
def index
|
|
5
12
|
authorize! :index, WcoEmail::Conversation
|
|
6
13
|
@conversations, @messages, @tag = WcoEmail::Conversation.load_conversations_messages_tag_by_params_and_profile( params, current_profile )
|
|
@@ -3,6 +3,35 @@ class WcoEmail::MessagesController < WcoEmail::ApplicationController
|
|
|
3
3
|
|
|
4
4
|
before_action :set_lists, except: %i| show_iframe |
|
|
5
5
|
|
|
6
|
+
def autorespond
|
|
7
|
+
@message = WcoEmail::Message.find params[:id]
|
|
8
|
+
authorize! :show, @message
|
|
9
|
+
|
|
10
|
+
task = 'You are an administrative assistant. Write a brief email response to the following email. exclude subject. exclude footer. exclude signature. format as <p></p> html paragraphs.'
|
|
11
|
+
content = @message.part_txt
|
|
12
|
+
outs = Wco::AiWriter.do_call(task, content)
|
|
13
|
+
puts! outs, 'outs'
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@ctx = WcoEmail::Context.new({
|
|
17
|
+
bcc_self: true,
|
|
18
|
+
body: outs,
|
|
19
|
+
email_template: WcoEmail::EmailTemplate.blank,
|
|
20
|
+
from_email: @message.to,
|
|
21
|
+
lead: @message.lead,
|
|
22
|
+
reply_to_message_id: @message.id,
|
|
23
|
+
# send_at: Time.now,
|
|
24
|
+
subject: @message.subject,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
if @ctx.save
|
|
28
|
+
flash_notice 'Saved.'
|
|
29
|
+
else
|
|
30
|
+
flash_alert @ctx
|
|
31
|
+
end
|
|
32
|
+
redirect_to request.referrer
|
|
33
|
+
end
|
|
34
|
+
|
|
6
35
|
def show
|
|
7
36
|
@client ||= Aws::S3::Client.new(::SES_S3_CREDENTIALS)
|
|
8
37
|
@message = WcoEmail::Message.find params[:id]
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
= f.check_box :bcc_self, checked: true
|
|
23
23
|
.field
|
|
24
24
|
%label To lead
|
|
25
|
-
= f.select :lead_id, options_for_select( @leads_list, selected: ctx.lead_id ), {}, { class: 'select2' }
|
|
25
|
+
= f.select :lead_id, options_for_select( @leads_list, selected: ctx.lead_id ), {}, { class: 'select2-leads-ajax' }
|
|
26
26
|
.field
|
|
27
27
|
%label cc
|
|
28
28
|
= f.text_field :cc, class: 'w-100'
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
= render '/wco_email/conversations/tags_actions'
|
|
17
17
|
= render '/wco/office_actions/actions'
|
|
18
18
|
|
|
19
|
+
.actions.d-flex
|
|
20
|
+
.a.mr-2= button_tag 'Delete', method: :delete, class: 'delete-btn', data: { url: '/email/api/conversations' }
|
|
21
|
+
|
|
22
|
+
= render 'wco/tags/actions', resource: 'WcoEmail::Conversation'
|
|
23
|
+
|
|
19
24
|
= render '/wco/paginate', resource: @conversations, param_name: ::WcoEmail::Conversation::PAGE_PARAM_NAME
|
|
20
25
|
= render '/wco_email/conversations/table', convs: @conversations
|
|
21
26
|
= render '/wco/paginate', resource: @conversations, param_name: ::WcoEmail::Conversation::PAGE_PARAM_NAME
|
|
@@ -46,4 +46,5 @@
|
|
|
46
46
|
= paginate @messages, param_name: :messages_page
|
|
47
47
|
|
|
48
48
|
- msg = @messages.last
|
|
49
|
-
= 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, email_template_id: ET.find_by( slug: 'blank').id })
|
|
49
|
+
= 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, email_template_id: ET.find_by( slug: 'blank').id })
|
|
50
|
+
= button_to 'autorespond', message_autorespond_path(msg), data: { confirm: 'Are you sure?' }
|
data/config/routes.rb
CHANGED
|
@@ -8,6 +8,7 @@ WcoEmail::Engine.routes.draw do
|
|
|
8
8
|
|
|
9
9
|
get 'api/contexts/summary', to: '/wco_email/api/contexts#summary'
|
|
10
10
|
get 'api/conversations', to: '/wco_email/api/conversations#index'
|
|
11
|
+
delete 'api/conversations', to: '/wco_email/api/conversations#destroy_many'
|
|
11
12
|
get 'api/email_action_templates', to: '/wco_email/api/email_action_templates#index'
|
|
12
13
|
get 'api/email_filters', to: '/wco_email/api/email_filters#index', defaults: { format: :json }
|
|
13
14
|
get 'api/email_filters/:id', to: '/wco_email/api/email_filters#show'
|
|
@@ -59,7 +60,8 @@ WcoEmail::Engine.routes.draw do
|
|
|
59
60
|
resources :lead_action_templates
|
|
60
61
|
resources :lead_actions
|
|
61
62
|
|
|
62
|
-
get
|
|
63
|
+
get 'messages/:id/iframe', to: 'messages#show_iframe', as: :message_iframe
|
|
64
|
+
post 'messages/:id/autorespond', to: 'messages#autorespond', as: :message_autorespond
|
|
63
65
|
resources :messages
|
|
64
66
|
|
|
65
67
|
post 'message_stub/:id/churn', to: 'message_stubs#churn', as: :churn_message_stub
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wco_email
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.1.
|
|
4
|
+
version: 0.1.1.136
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Victor Pudeyev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-s3
|