ish_models 0.0.33.207 → 0.0.33.208
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/office/email_conversation.rb +14 -9
- data/lib/office/email_message.rb +2 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2b1de33b06b694c8c498fcaf8e9f1be0043cfb671f1320714e161e4a6928b6e
|
4
|
+
data.tar.gz: 8ccd99db6e28a9ae30672596f9d237b2f9e8c191d3e9ca61a4e84010fde64071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ea0f2df2d7f9de7ddf355400f511148969dea84974f6f6472e09befdb020e7e5859a5195c6c20dcfe42e67c3b4bb1ed36cd1a0fbb6ca57eb68711d4656d4786
|
7
|
+
data.tar.gz: 82460cced11f3de8bcc2963f681c964fbef19fa605ea14a1dd9a5954260d540486a49d7c2fab3227401ff94908953f6438863331b2213c439a3b62001c36a3d7
|
@@ -54,17 +54,22 @@ class Office::EmailConversation
|
|
54
54
|
else
|
55
55
|
throw "#remove_tag expects a WpTag or string (eg WpTag::EMAILTAG_INBOX) as the only parameter."
|
56
56
|
end
|
57
|
-
self[:wp_term_ids]
|
58
|
-
self.save!
|
59
|
-
|
60
|
-
|
61
|
-
def self.in_inbox
|
62
|
-
::Office::EmailConversation.where( :wp_term_ids => WpTag.email_inbox_tag.id ).order_by( latest_at: :desc )
|
57
|
+
self[:wp_term_ids] = self[:wp_term_ids] - [ tag.id ]
|
58
|
+
out = self.save!
|
59
|
+
out
|
63
60
|
end
|
61
|
+
def rmtag tag; remove_tag tag; end
|
64
62
|
|
65
|
-
def self.
|
66
|
-
|
67
|
-
|
63
|
+
def self.not_in_emailtag which
|
64
|
+
case which.class.name
|
65
|
+
when 'String'
|
66
|
+
tag_id = WpTag.emailtag(which).id
|
67
|
+
when 'WpTag'
|
68
|
+
tag_id = which.id
|
69
|
+
else
|
70
|
+
throw "unsupported in #not_in_emailtag: #{which}"
|
71
|
+
end
|
72
|
+
return ::Office::EmailConversation.where( :wp_term_ids.ne => tag_id ).order_by( latest_at: :desc )
|
68
73
|
end
|
69
74
|
|
70
75
|
def self.in_emailtag which
|
data/lib/office/email_message.rb
CHANGED
@@ -64,7 +64,7 @@ class Office::EmailMessage
|
|
64
64
|
email_conversation
|
65
65
|
end
|
66
66
|
|
67
|
-
## @TODO: reimplement
|
67
|
+
## @TODO: reimplement
|
68
68
|
def name
|
69
69
|
return 'associate'
|
70
70
|
# from[0].split('@')[0].upcase
|
@@ -77,23 +77,12 @@ class Office::EmailMessage
|
|
77
77
|
def apply_filter filter
|
78
78
|
case filter.kind
|
79
79
|
when ::Office::EmailFilter::KIND_SKIP_INBOX
|
80
|
-
self.remove_tag( ::
|
80
|
+
self.remove_tag( WpTag::INBOX )
|
81
81
|
when ::Office::EmailFilter::KIND_AUTORESPOND
|
82
82
|
Ish::EmailContext.create({
|
83
83
|
email_template: ::Tmpl.find_by_slug( filter.email_template_slug ),
|
84
84
|
lead: lead,
|
85
85
|
})
|
86
|
-
# when 'autorespond-remind'
|
87
|
-
# Office::EmailAction.create({
|
88
|
-
# tmpl_slug: 'require-sign-nda',
|
89
|
-
# next_in_days: -> { rand(1..5) },
|
90
|
-
# next_at_time: ->{ rand(8..16).hours + rand(1..59).minutes },
|
91
|
-
# next_action: 're-remind-sign-nda',
|
92
|
-
# })
|
93
|
-
# Ish::EmailContext.create({
|
94
|
-
# email_template: ::Tmpl.find_by_slug( filter.email_template_slug ),
|
95
|
-
# lead: lead,
|
96
|
-
# })
|
97
86
|
else
|
98
87
|
raise "unknown filter kind: #{filter.kind}"
|
99
88
|
end
|