ish_models 0.0.33.183 → 0.0.33.184
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish/email_context.rb +27 -4
- data/lib/ish/{campaign.rb → trash/email_campaign.rb} +8 -3
- data/lib/ish_models.rb +1 -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: 3e6eff98102df0e1c876a6efbead562210b0d6863d9a75574aef191c778a011b
|
4
|
+
data.tar.gz: 5a5b1eaab82f0ccb24304b8ee61821504c3940e8cca6e54ef4ec161c5394dc7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35fb3fc9226c8720e083090b86bca77399bfa62a99cc4c1e3650688a25a4f9f9ab1dc59c825f258f6e25016cf7c5fafb6b223d1b16553555858783b9b7c11f2
|
7
|
+
data.tar.gz: af86d30206881902dc9654d38a903f6b1a7fbd41f81c1719b959478ddcf2ab691ae03d83edbec538098137bc4812427ab3d08326052fc4da4821f426ef878025
|
data/lib/ish/email_context.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
|
2
2
|
#
|
3
|
-
#
|
3
|
+
# Sends a single email, or a campaign.
|
4
4
|
#
|
5
5
|
|
6
6
|
class Ish::EmailContext
|
7
7
|
include Mongoid::Document
|
8
8
|
include Mongoid::Timestamps
|
9
9
|
|
10
|
+
field :title
|
11
|
+
|
10
12
|
PAGE_PARAM_NAME = 'email_contexts_page'
|
11
13
|
|
12
14
|
FROM_EMAILS = %w| piousbox@gmail.com victor@piousbox.com victor@wasya.co no-reply@piousbox.com |
|
@@ -16,8 +18,13 @@ class Ish::EmailContext
|
|
16
18
|
[ [nil, nil] ] + FROM_EMAILS.map { |i| [i, i] }
|
17
19
|
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
+
TYPE_SINGLE = 'TYPE_SINGLE'
|
22
|
+
TYPE_CAMPAIGN = 'TYPE_CAMPAIGN'
|
23
|
+
field :type, default: TYPE_SINGLE
|
24
|
+
def self.types_list
|
25
|
+
[ [TYPE_SINGLE, TYPE_SINGLE], [TYPE_CAMPAIGN, TYPE_CAMPAIGN] ]
|
26
|
+
end
|
27
|
+
|
21
28
|
|
22
29
|
field :subject
|
23
30
|
validates_presence_of :subject
|
@@ -30,11 +37,27 @@ class Ish::EmailContext
|
|
30
37
|
field :rendered_str
|
31
38
|
|
32
39
|
field :sent_at, type: DateTime
|
40
|
+
field :scheduled_at, type: DateTime
|
41
|
+
|
42
|
+
def leads
|
43
|
+
if self.type == TYPE_CAMPAIGN
|
44
|
+
return ::EmailCampaignLead.where( email_campaign_id: self.id.to_s ).includes( :lead ).map { |p| p.lead }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
33
48
|
|
34
49
|
#
|
35
50
|
# For templating:
|
36
51
|
#
|
37
|
-
field :
|
52
|
+
field :tmpl_name
|
53
|
+
|
54
|
+
field :to_email
|
55
|
+
validates_presence_of :to_email, if: -> { type == TYPE_SINGLE }
|
56
|
+
|
57
|
+
#
|
58
|
+
# For tracking
|
59
|
+
#
|
60
|
+
attr_reader :tid
|
38
61
|
|
39
62
|
end
|
40
63
|
EmailContext = Ish::EmailContext
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
class Ish::EmailCampaign
|
2
3
|
include Mongoid::Document
|
3
4
|
include Mongoid::Timestamps
|
4
5
|
|
@@ -12,12 +13,16 @@ class Ish::Campaign
|
|
12
13
|
field :subject
|
13
14
|
field :body
|
14
15
|
|
16
|
+
## @TODO: tags instead?
|
15
17
|
field :is_done, :type => Boolean, :default => false
|
16
18
|
field :is_trash, :type => Boolean, :default => false
|
19
|
+
field :tag # 'hired_com_ror', not enumerated for now _vp_ 20180103
|
17
20
|
|
21
|
+
## @TODO: sent on, scheduled_on, ...
|
18
22
|
field :applied_on, :type => Time
|
19
23
|
|
20
|
-
|
21
|
-
|
24
|
+
## Need tracking!
|
25
|
+
|
26
|
+
## this looks like an email_context, copy from there.
|
22
27
|
|
23
28
|
end
|
data/lib/ish_models.rb
CHANGED
@@ -43,8 +43,8 @@ require 'gameui/marker'
|
|
43
43
|
require 'gameui/premium_purchase'
|
44
44
|
|
45
45
|
require 'ish/cache_key'
|
46
|
-
require 'ish/campaign'
|
47
46
|
require 'ish/crawler'
|
47
|
+
# require 'ish/email_campaign' ## context + leadset is a campaign.
|
48
48
|
require 'ish/email_context'
|
49
49
|
require 'ish/email_template'
|
50
50
|
require 'ish/email_unsubscribe'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.33.
|
4
|
+
version: 0.0.33.184
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -123,7 +123,6 @@ files:
|
|
123
123
|
- lib/gameui/marker.rb
|
124
124
|
- lib/gameui/premium_purchase.rb
|
125
125
|
- lib/ish/cache_key.rb
|
126
|
-
- lib/ish/campaign.rb
|
127
126
|
- lib/ish/configuration.rb
|
128
127
|
- lib/ish/crawler.rb
|
129
128
|
- lib/ish/email_context.rb
|
@@ -141,6 +140,7 @@ files:
|
|
141
140
|
- lib/ish/payment.rb
|
142
141
|
- lib/ish/premium_item.rb
|
143
142
|
- lib/ish/railtie.rb
|
143
|
+
- lib/ish/trash/email_campaign.rb
|
144
144
|
- lib/ish/user_profile.rb
|
145
145
|
- lib/ish/utils.rb
|
146
146
|
- lib/ish_models.rb
|