ish_models 0.0.33.271 → 0.0.33.272

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c695f34fb6f38b0daca48bda88a508f027db99f726989a9418d975b5026541a
4
- data.tar.gz: 34fed5affbb1c25f15d4940fe1766cd51d4ab7f26fc73de646ddf0426035f1d0
3
+ metadata.gz: 569fd681a6098f88e39d36996bc031e4094d57d4250efdf5d76961857b8b5987
4
+ data.tar.gz: 5737743c665eb8998829713413e0f5c70273596c0d749c6ab2a1ef366498fa1d
5
5
  SHA512:
6
- metadata.gz: 0d93535ede083430aa2ee86109548a3f8af463021fb95078b5864347431a9bd6ebb73cbd39ff69bb16cdacb8f992f218baa4cdba53e4c844feb9f25e45dfd87c
7
- data.tar.gz: a7c61121c5741d2232a5dda85ae16793d317b3aed5fe808f9b025d9d13a611c0f49579b1d581a3001fa969b8ca6b94958fad24ad3ff0de84af51f47a41730078
6
+ metadata.gz: 6c97854130e7399943406ac285198bbd101d4d3f06a9daa478f6266079b70efc4f62e287e1b1660f51c7187f41241b1b8c62cae8b4a5a6e8eb061d65ebb0030f
7
+ data.tar.gz: 8912dcb2e23c9da38481c5af234b66bfdab701ffc4ca016f3747b5ff81e0c59bb63c307c4fab62c145dcdfe74ad7b78f2d49daac301098c7216796060a81830e
@@ -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,8 @@ 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>',
67
71
  ];
68
72
  field :from_email
69
73
  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.272
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -173,6 +173,7 @@ files:
173
173
  - lib/newsitem.rb
174
174
  - lib/office/action.rb
175
175
  - lib/office/action_tie.rb
176
+ - lib/office/admin_message.rb
176
177
  - lib/office/email_action.rb
177
178
  - lib/office/email_action_tie.rb
178
179
  - lib/office/email_conversation.rb