ish_models 0.0.33.271 → 0.0.33.273

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c695f34fb6f38b0daca48bda88a508f027db99f726989a9418d975b5026541a
4
- data.tar.gz: 34fed5affbb1c25f15d4940fe1766cd51d4ab7f26fc73de646ddf0426035f1d0
3
+ metadata.gz: ce4483156eaf2753a2d09a143a69c40c07208ec608bf53cc7541d20dd132c8e4
4
+ data.tar.gz: abbdb42d7fa52d1616c41308032018792f7cdefa97b5b1558be8ac43bf68d379
5
5
  SHA512:
6
- metadata.gz: 0d93535ede083430aa2ee86109548a3f8af463021fb95078b5864347431a9bd6ebb73cbd39ff69bb16cdacb8f992f218baa4cdba53e4c844feb9f25e45dfd87c
7
- data.tar.gz: a7c61121c5741d2232a5dda85ae16793d317b3aed5fe808f9b025d9d13a611c0f49579b1d581a3001fa969b8ca6b94958fad24ad3ff0de84af51f47a41730078
6
+ metadata.gz: 6b412ba5b025855be856f61b381f99c2d3e5c39b85bb17c4feed51fcdfb36656b9127d2914decc5d200c497866e67fac04f35c3525695915ca3eb463b9105bbd
7
+ data.tar.gz: 1fc79583fc22834902608533057a2a13edcfaaa6d29630daae77fe5dfd80fa5415758116606e5a83fd4760f926d52f4a446cb684bdf54972ac379ccb91086aa9
@@ -15,15 +15,6 @@ class Ish::EmailCampaign
15
15
 
16
16
  field :from_email
17
17
  validates_presence_of :from_email
18
- FROM_EMAILS = %w| hello@infiniteshelter.com no-reply@infiniteshelter.com
19
- piousbox@gmail.com
20
- hello@piousbox.com no-reply@piousbox.com victor@piousbox.com
21
- admin@wasya.co hello@wasya.co no-reply@wasya.co victor@wasya.co
22
- admin@mail.wasyaco.com hello@mail.wasyaco.com no-reply@mail.wasyaco.com victor@mail.wasyaco.com
23
- |;
24
- def self.from_email_list
25
- [ [nil, nil] ] + FROM_EMAILS.map { |i| [i, i] }
26
- end
27
18
 
28
19
  belongs_to :email_template
29
20
  def tmpl; email_template; end
@@ -70,10 +70,6 @@ class ::Ish::EmailContext
70
70
  def self.scheduled; new.scheduled; end
71
71
 
72
72
 
73
- def self.from_email_list
74
- Ish::EmailCampaign.from_email_list
75
- end
76
-
77
73
  ## like belongs_to to_lead , but Lead is SQL to just the lead_id
78
74
  field :lead_id, type: :integer
79
75
  def lead; Lead.find( lead_id ); end
@@ -93,6 +89,7 @@ class ::Ish::EmailContext
93
89
  'utm_medium' => 'email',
94
90
  'utm_source' => tmpl.slug,
95
91
  }.map { |k, v| "#{k}=#{v}" }.join("&")
92
+ eval( tmpl.config_exe )
96
93
  binding()
97
94
  end
98
95
 
@@ -13,6 +13,7 @@ class ::Ish::EmailTemplate
13
13
  LAYOUTS = %w| plain
14
14
  m20221201react m20221222merryxmas
15
15
  m202309_feedback
16
+ m202309_ror4
16
17
  marketing_node_1
17
18
  marketing_react_1 marketing_react_2 marketing_react_3
18
19
  marketing_ror_1 marketing_ror_2
@@ -25,7 +26,8 @@ class ::Ish::EmailTemplate
25
26
  field :subject
26
27
  field :body
27
28
  field :can_unsubscribe, type: :boolean, default: true
28
- field :config_exe, default: ""
29
+ field :config_exe, default: "" ## used a lot.
30
+ field :config_json, type: Object, default: '{}'
29
31
 
30
32
  FROM_EMAILS = [
31
33
  'Annesque Studio <hello@annesque.studio>',
@@ -64,6 +66,9 @@ class ::Ish::EmailTemplate
64
66
  'WasyaCo Consulting <hello@wasyaco.com>',
65
67
  'WasyaCo Consulting <no-reply@wasyaco.com>',
66
68
  'Victor <victor@wasyaco.com>',
69
+
70
+ 'Wasya Co Mailer <no-reply@wco.com.de>',
71
+ 'Wasya Co Mailer <wasyacomailer@gmail.com>',
67
72
  ];
68
73
  field :from_email
69
74
  def self.from_email_list
data/lib/ish_models.rb CHANGED
@@ -65,6 +65,7 @@ require 'video'
65
65
 
66
66
  require 'office/action'
67
67
  require 'office/action_tie'
68
+ require 'office/admin_message'
68
69
  require 'office/email_action'
69
70
  require 'office/email_action_tie'
70
71
  require 'office/email_conversation'
@@ -0,0 +1,11 @@
1
+
2
+
3
+ class Office::AdminMessage
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+
7
+ field :message
8
+
9
+ end
10
+
11
+
@@ -33,27 +33,25 @@ class Office::ScheduledEmailAction
33
33
 
34
34
  def send_and_roll
35
35
  sch = self
36
- sch.update_attributes({ state: Sch::STATE_INACTIVE })
36
+ sch.update({ state: Sch::STATE_INACTIVE })
37
37
 
38
38
  # send now
39
39
  ctx = Ctx.create!({
40
- email_template_id: sch.act.tmpl.id,
41
- lead_id: sch.lead.id,
42
- send_at: Time.now,
43
- subject: sch.act.tmpl.subject,
44
- from_email: sch.act.tmpl.from_email,
40
+ email_template_id: sch.act.tmpl.id,
41
+ from_email: sch.act.tmpl.from_email,
42
+ lead_id: sch.lead.id,
45
43
  scheduled_email_action_id: sch.act.id,
44
+ send_at: Time.now,
45
+ subject: sch.act.tmpl.subject,
46
46
  })
47
47
 
48
48
  # schedule next actions & update the action
49
49
  sch.act.ties.each do |tie|
50
- next_act = tie.next_email_action
51
- next_at = eval(tie.next_at_exe)
52
50
  next_sch = Sch.find_or_initialize_by({
53
- lead_id: sch.lead_id,
54
- email_action_id: next_act.id,
51
+ lead_id: sch.lead_id,
52
+ email_action_id: tie.next_email_action.id,
55
53
  })
56
- next_sch.perform_at = next_at
54
+ next_sch.perform_at = eval(tie.next_at_exe)
57
55
  next_sch.state = Sch::STATE_ACTIVE
58
56
  next_sch.save!
59
57
  end
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.271
4
+ version: 0.0.33.273
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -136,6 +136,48 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 7.1.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: prawn
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 2.4.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 2.4.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: prawn-table
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.2.1
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.2.1
167
+ - !ruby/object:Gem::Dependency
168
+ name: net-scp
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 4.0.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 4.0.0
139
181
  description: models of ish
140
182
  email: victor@wasya.co
141
183
  executables: []
@@ -173,6 +215,7 @@ files:
173
215
  - lib/newsitem.rb
174
216
  - lib/office/action.rb
175
217
  - lib/office/action_tie.rb
218
+ - lib/office/admin_message.rb
176
219
  - lib/office/email_action.rb
177
220
  - lib/office/email_action_tie.rb
178
221
  - lib/office/email_conversation.rb