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 +4 -4
- data/lib/ish/email_context.rb +16 -4
- data/lib/ish/user_profile.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 626e313e49afc2fa1cb393c23b9d3259495eea073c618ef032744b480d4cec9f
|
4
|
+
data.tar.gz: da91ac290e6c5913ec26751a6884c4ecf420e0dd56cf6197547b0868cc4bf2a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 512418c18cfc423ff4589df45af395c3bc3e6bdb047557a1ee103c78813249bd4f259bbd07cf2b20b3eaccbb88716234d5c5c3d106fd71e092aa396bab4fccf3
|
7
|
+
data.tar.gz: f3192ef13c8fd5374c76358ecf7318e6c9d44989dd3c2ad96ba6e1cd0f5869f3a31ad944b72ea235244292fb70c623039645ce396c55560d65fc54ded46e1269
|
data/lib/ish/email_context.rb
CHANGED
@@ -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
|
-
|
62
|
-
|
63
|
-
|
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 }
|
data/lib/ish/user_profile.rb
CHANGED
@@ -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
|
|