ish_models 0.0.33.185 → 0.0.33.187

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: 85b9a6758d41c84ed2393951c0e8bd9733d92f745859689e64940677205962bf
4
- data.tar.gz: 4133474740d173f9eddc0339a2c8fcc2b335a199db36f2f19cc813afe2889594
3
+ metadata.gz: 626e313e49afc2fa1cb393c23b9d3259495eea073c618ef032744b480d4cec9f
4
+ data.tar.gz: da91ac290e6c5913ec26751a6884c4ecf420e0dd56cf6197547b0868cc4bf2a0
5
5
  SHA512:
6
- metadata.gz: 4139e2903f034633a246aa43217b5f7eb64f3a5ec475774633d28b97984da2b35fa5ec4fde1ec4798b6c04f49c855db258df812f9dcb1e18e069326886d58031
7
- data.tar.gz: 2ce2bed1e8a34efa83e643de5277561c3bc804503c5f6c293e72025ba639fc3b489eebd6d21296fe8d4598f1401bf9387d7fcfa21c686b30b3ed0e4c54a4d3c1
6
+ metadata.gz: 512418c18cfc423ff4589df45af395c3bc3e6bdb047557a1ee103c78813249bd4f259bbd07cf2b20b3eaccbb88716234d5c5c3d106fd71e092aa396bab4fccf3
7
+ data.tar.gz: f3192ef13c8fd5374c76358ecf7318e6c9d44989dd3c2ad96ba6e1cd0f5869f3a31ad944b72ea235244292fb70c623039645ce396c55560d65fc54ded46e1269
@@ -46,6 +46,10 @@ class Ish::EmailContext
46
46
  Ish::EmailContext.where( type: TYPE_CAMPAIGN )
47
47
  end
48
48
 
49
+ def self.unsent_campaigns
50
+ Ish::EmailContext.where( type: TYPE_CAMPAIGN, sent_at: nil )
51
+ end
52
+
49
53
  def campaign_leads
50
54
  if self.type == TYPE_CAMPAIGN
51
55
  return ::EmailCampaignLead.where( email_campaign_id: self.id.to_s ).includes( :lead )
@@ -57,10 +61,18 @@ class Ish::EmailContext
57
61
  end
58
62
 
59
63
 
60
- #
61
- # For templating:
62
- #
63
- field :tmpl_name
64
+ ##
65
+ ## For templating:
66
+ ##
67
+ ## commonly: name, companyName
68
+ field :tmpl, type: Hash, default: {}
69
+ def body_templated
70
+ out = email_template.body
71
+ tmpl.each do |k, v|
72
+ out.gsub!("{#{k}}", v)
73
+ end
74
+ out
75
+ end
64
76
 
65
77
  field :to_email
66
78
  validates_presence_of :to_email, if: -> { type == TYPE_SINGLE }
@@ -54,7 +54,6 @@ class Ish::UserProfile
54
54
  has_many :my_maps, :inverse_of => :creator_profile, class_name: 'Gameui::Map'
55
55
 
56
56
  has_many :invoices, :class_name => '::Ish::Invoice'
57
- has_many :leads, :class_name => '::Ish::Lead'
58
57
  has_many :photos
59
58
  has_many :reports, inverse_of: :user_profile
60
59
 
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.185
4
+ version: 0.0.33.187
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox