ish_models 0.0.33.270 → 0.0.33.271
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gallery.rb +4 -2
- data/lib/ish/email_campaign.rb +2 -0
- data/lib/ish/email_context.rb +0 -1
- data/lib/ish/email_template.rb +5 -1
- data/lib/ish/email_unsubscribe.rb +5 -5
- data/lib/ish_models.rb +3 -1
- data/lib/newsitem.rb +1 -1
- data/lib/office/lead_action.rb +21 -0
- data/lib/office/lead_action_template.rb +40 -0
- data/lib/office/obfuscated_redirect.rb +12 -0
- data/lib/office/scheduled_email_action.rb +5 -4
- data/lib/video.rb +3 -0
- metadata +4 -3
- data/lib/ish/gallery_name.rb +0 -10
- data/lib/newsitem.rb-trash +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c695f34fb6f38b0daca48bda88a508f027db99f726989a9418d975b5026541a
|
4
|
+
data.tar.gz: 34fed5affbb1c25f15d4940fe1766cd51d4ab7f26fc73de646ddf0426035f1d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d93535ede083430aa2ee86109548a3f8af463021fb95078b5864347431a9bd6ebb73cbd39ff69bb16cdacb8f992f218baa4cdba53e4c844feb9f25e45dfd87c
|
7
|
+
data.tar.gz: a7c61121c5741d2232a5dda85ae16793d317b3aed5fe808f9b025d9d13a611c0f49579b1d581a3001fa969b8ca6b94958fad24ad3ff0de84af51f47a41730078
|
data/lib/gallery.rb
CHANGED
@@ -14,13 +14,15 @@ class Gallery
|
|
14
14
|
field :subhead
|
15
15
|
field :descr, :as => :description
|
16
16
|
|
17
|
-
field :is_public,
|
17
|
+
field :is_public, type: Boolean, default: false
|
18
18
|
has_and_belongs_to_many :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_galleries
|
19
19
|
|
20
20
|
field :is_trash, type: Boolean, default: false
|
21
21
|
field :is_done, type: Boolean, default: false
|
22
22
|
|
23
|
-
|
23
|
+
def public
|
24
|
+
where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc })
|
25
|
+
end
|
24
26
|
|
25
27
|
field :x, :type => Float
|
26
28
|
field :y, :type => Float
|
data/lib/ish/email_campaign.rb
CHANGED
@@ -34,6 +34,8 @@ class Ish::EmailCampaign
|
|
34
34
|
field :sent_at, type: DateTime
|
35
35
|
field :send_at, type: DateTime
|
36
36
|
|
37
|
+
has_many :unsubscribes, class_name: '::Ish::EmailUnsubscribe', inverse_of: :campaign
|
38
|
+
|
37
39
|
def campaign_leads
|
38
40
|
return ::EmailCampaignLead.where( email_campaign_id: self.id.to_s ).includes( :lead )
|
39
41
|
end
|
data/lib/ish/email_context.rb
CHANGED
data/lib/ish/email_template.rb
CHANGED
@@ -12,6 +12,7 @@ class ::Ish::EmailTemplate
|
|
12
12
|
field :layout, type: :string, default: 'plain'
|
13
13
|
LAYOUTS = %w| plain
|
14
14
|
m20221201react m20221222merryxmas
|
15
|
+
m202309_feedback
|
15
16
|
marketing_node_1
|
16
17
|
marketing_react_1 marketing_react_2 marketing_react_3
|
17
18
|
marketing_ror_1 marketing_ror_2
|
@@ -23,6 +24,8 @@ class ::Ish::EmailTemplate
|
|
23
24
|
|
24
25
|
field :subject
|
25
26
|
field :body
|
27
|
+
field :can_unsubscribe, type: :boolean, default: true
|
28
|
+
field :config_exe, default: ""
|
26
29
|
|
27
30
|
FROM_EMAILS = [
|
28
31
|
'Annesque Studio <hello@annesque.studio>',
|
@@ -75,7 +78,8 @@ class ::Ish::EmailTemplate
|
|
75
78
|
|
76
79
|
has_many :email_actions, class_name: '::Office::EmailAction'
|
77
80
|
has_many :email_contexts, class_name: '::Ish::EmailContext'
|
78
|
-
has_many :email_filters, class_name: '::Office::EmailFilter',
|
81
|
+
has_many :email_filters, class_name: '::Office::EmailFilter', inverse_of: :email_template
|
82
|
+
has_many :unsubscribes, class_name: '::Ish::EmailUnsubscribe', inverse_of: :template
|
79
83
|
|
80
84
|
SLUG_BLANK = 'blank'
|
81
85
|
def self.blank_template
|
@@ -4,15 +4,15 @@ class Ish::EmailUnsubscribe
|
|
4
4
|
include Mongoid::Timestamps
|
5
5
|
|
6
6
|
field :email
|
7
|
-
validates_presence_of :email
|
8
|
-
validates_uniqueness_of :email
|
9
|
-
|
10
|
-
field :mailer_type
|
7
|
+
# validates_presence_of :email
|
8
|
+
# validates_uniqueness_of :email
|
11
9
|
|
10
|
+
field :lead_id
|
12
11
|
field :reason
|
13
|
-
|
14
12
|
field :unsubscribed_at
|
15
13
|
|
14
|
+
belongs_to :campaign, class_name: '::Ish::EmailCampaign', inverse_of: :unsubscribes
|
15
|
+
belongs_to :template, class_name: '::Ish::EmailTemplate', inverse_of: :unsubscribes
|
16
16
|
|
17
17
|
|
18
18
|
end
|
data/lib/ish_models.rb
CHANGED
@@ -49,7 +49,6 @@ require 'ish/email_context'
|
|
49
49
|
require 'ish/email_template'
|
50
50
|
require 'ish/email_unsubscribe'
|
51
51
|
require 'ish/event'
|
52
|
-
require 'ish/gallery_name'
|
53
52
|
require 'ish/image_asset'
|
54
53
|
require 'ish/invoice'
|
55
54
|
require 'ish/lorem_ipsum'
|
@@ -72,6 +71,9 @@ require 'office/email_conversation'
|
|
72
71
|
require 'office/email_filter'
|
73
72
|
require 'office/email_message'
|
74
73
|
require 'office/email_message_stub'
|
74
|
+
require 'office/lead_action'
|
75
|
+
require 'office/lead_action_template'
|
76
|
+
require 'office/obfuscated_redirect'
|
75
77
|
require 'office/scheduled_email_action'
|
76
78
|
|
77
79
|
require 'wco/appliance'
|
data/lib/newsitem.rb
CHANGED
@@ -16,7 +16,7 @@ class Newsitem
|
|
16
16
|
self.gallery_id ? Gallery.unscoped.find( self.gallery_id ) : nil
|
17
17
|
end
|
18
18
|
belongs_to :map, optional: true, class_name: '::Gameui::Map'
|
19
|
-
belongs_to :profile, optional: true, class_name: 'Ish::UserProfile'
|
19
|
+
belongs_to :profile, optional: true, class_name: '::Ish::UserProfile'
|
20
20
|
belongs_to :photo, optional: true
|
21
21
|
belongs_to :report, optional: true
|
22
22
|
belongs_to :video, optional: true
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
##
|
3
|
+
## The obfuscated action
|
4
|
+
##
|
5
|
+
class Office::LeadAction
|
6
|
+
include Mongoid::Document
|
7
|
+
include Mongoid::Timestamps
|
8
|
+
|
9
|
+
belongs_to :lead_action_template, class_name: '::Office::LeadActionTemplate', inverse_of: :lead_actions, foreign_key: :tmpl_id
|
10
|
+
|
11
|
+
field :lead_id, type: :integer
|
12
|
+
validates :lead_id, presence: true
|
13
|
+
def lead
|
14
|
+
Lead.find( lead_id )
|
15
|
+
end
|
16
|
+
|
17
|
+
field :params, type: Object
|
18
|
+
|
19
|
+
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
##
|
3
|
+
##
|
4
|
+
class Office::LeadActionTemplate
|
5
|
+
include Mongoid::Document
|
6
|
+
include Mongoid::Timestamps
|
7
|
+
|
8
|
+
has_many :lead_actions, class_name: '::Office::LeadAction', inverse_of: :lead_action_templates
|
9
|
+
|
10
|
+
field :slug
|
11
|
+
validates :slug, presence: true
|
12
|
+
|
13
|
+
field :action_exe, type: :string
|
14
|
+
# validates :action_exe, presence: true
|
15
|
+
|
16
|
+
field :config_json, type: Object, default: '{}'
|
17
|
+
|
18
|
+
field :kind, type: :string
|
19
|
+
KIND_UNSUBSCRIBE_TEMPLATE = 'kind-unsubscribe-template'
|
20
|
+
KIND_UNSUBSCRIBE_CAMPAIGN = 'kind-unsubscribe-campaign'
|
21
|
+
KINDS = [ KIND_UNSUBSCRIBE_TEMPLATE, KIND_UNSUBSCRIBE_CAMPAIGN ]
|
22
|
+
|
23
|
+
|
24
|
+
def unsubscribe_from_campaign
|
25
|
+
end
|
26
|
+
|
27
|
+
def unsubscribe_from_template
|
28
|
+
template = EmailTemplate.find( ctx[:template_id] )
|
29
|
+
subject = "Lead #{lead.full_name} unsubscribed from template #{template.slug}"
|
30
|
+
out = Mailer.notify( 'poxlovi@gmail.com', subject )
|
31
|
+
Rails.env.production? ? out.deliver_later : out.deliver_now
|
32
|
+
Office::Unsubscribe.create({
|
33
|
+
lead_id: lead_id,
|
34
|
+
template_id: config_json['template_id'],
|
35
|
+
})
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
end
|
40
|
+
|
@@ -13,10 +13,11 @@ class Office::ScheduledEmailAction
|
|
13
13
|
Lead.find( lead_id )
|
14
14
|
end
|
15
15
|
|
16
|
-
STATE_ACTIVE
|
17
|
-
STATE_INACTIVE
|
18
|
-
STATE_TRASH
|
19
|
-
|
16
|
+
STATE_ACTIVE = 'active'
|
17
|
+
STATE_INACTIVE = 'inactive'
|
18
|
+
STATE_TRASH = 'trash'
|
19
|
+
STATE_UNSUBSCRIBED = 'unsubscribed'
|
20
|
+
STATES = [ STATE_ACTIVE, STATE_INACTIVE, STATE_UNSUBSCRIBED, STATE_TRASH ]
|
20
21
|
field :state, type: :string
|
21
22
|
scope :active, ->{ where( state: STATE_ACTIVE ) }
|
22
23
|
|
data/lib/video.rb
CHANGED
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.271
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -158,7 +158,6 @@ files:
|
|
158
158
|
- lib/ish/email_template.rb
|
159
159
|
- lib/ish/email_unsubscribe.rb
|
160
160
|
- lib/ish/event.rb
|
161
|
-
- lib/ish/gallery_name.rb
|
162
161
|
- lib/ish/image_asset.rb
|
163
162
|
- lib/ish/invoice.rb
|
164
163
|
- lib/ish/lorem_ipsum.rb
|
@@ -172,7 +171,6 @@ files:
|
|
172
171
|
- lib/mongoid/votable.rb
|
173
172
|
- lib/mongoid/voter.rb
|
174
173
|
- lib/newsitem.rb
|
175
|
-
- lib/newsitem.rb-trash
|
176
174
|
- lib/office/action.rb
|
177
175
|
- lib/office/action_tie.rb
|
178
176
|
- lib/office/email_action.rb
|
@@ -181,6 +179,9 @@ files:
|
|
181
179
|
- lib/office/email_filter.rb
|
182
180
|
- lib/office/email_message.rb
|
183
181
|
- lib/office/email_message_stub.rb
|
182
|
+
- lib/office/lead_action.rb
|
183
|
+
- lib/office/lead_action_template.rb
|
184
|
+
- lib/office/obfuscated_redirect.rb
|
184
185
|
- lib/office/scheduled_email_action.rb
|
185
186
|
- lib/photo.rb
|
186
187
|
- lib/report.rb
|
data/lib/ish/gallery_name.rb
DELETED