ish_models 0.0.33.297 → 0.0.33.299

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: 9b50c2d5f3c7332ce08f7a0370514bfaa1f9f28c05df96be4cabe293392c30a3
4
- data.tar.gz: 84b3e52133ab4dcdda7cc1433350352319ef30e5d79d806d2125924eeb4981a5
3
+ metadata.gz: fa44087f500e7920ced4feaf0beb2374ec5cc3a022b64c37b8543c6437ebb2b8
4
+ data.tar.gz: 1ec1b0bd08816c041822cd8633015f88084f02dc2cdb846ea8b9e5b99331560b
5
5
  SHA512:
6
- metadata.gz: 00d336c20641040168dc13f87574fd9d8edcf8cfad12446b41caddedb6da5cea73043be709d6a7682e774ef14352e792e629645475b13434993fb634456d8ee2
7
- data.tar.gz: 55e0a1eca6a8115331e539ced6ac2bda15c7e6ed8528b6ec7aef394d82b5b3f62699342f87656c0bf0b95508199cc1c49acc4901ce7f0f60eb7188cf5f4dc1f4
6
+ metadata.gz: 1343879402cbe9523d920f87ba9a12b39c7a5e9438d14383ef9cb08b2022dd4b4ef75f5da6104fea82cf8015e757e04685ec49bfb8f5d11c0fae1c45400dd452
7
+ data.tar.gz: 955585c6273244c0b72880213d9edbbeee90050f48f1260183c3e9e0a04fa3303247625477eea1afdf09116405f7aa08190adcf2835b46e72efce4b486576282
data/lib/ish_models.rb CHANGED
@@ -66,6 +66,7 @@ require 'video'
66
66
  require 'office/action'
67
67
  require 'office/action_tie'
68
68
  require 'office/admin_message'
69
+ require 'office/directmail_envelope'
69
70
  require 'office/email_action'
70
71
  require 'office/email_action_tie'
71
72
  require 'office/email_attachment'
@@ -80,6 +81,7 @@ require 'office/lead_action_template'
80
81
  require 'office/obfuscated_redirect'
81
82
  require 'office/scheduled_email_action'
82
83
 
84
+
83
85
  require 'wco/appliance'
84
86
  require 'wco/appliance_tmpl'
85
87
  require 'wco/leadset'
@@ -0,0 +1,51 @@
1
+ require 'prawn'
2
+
3
+ class Office::DirectmailEnvelope
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+
7
+
8
+ ## 72 points per inch
9
+ ## 72 ppi
10
+ def self.list_to_envelopes props
11
+ from = props[:from]
12
+
13
+ pdf = Prawn::Document.new({ page_size: [ 9.5*72, 4.12*72 ], :margin => [0,0,0,0] })
14
+
15
+ pdf.canvas do
16
+
17
+ props[:tos].each_with_index do |to, idx|
18
+ print '.'
19
+
20
+ pdf.bounding_box( [ 0.5*72, 3.5*72 ], width: 3*72, height: 2*72 ) do
21
+ # pdf.transparent(0.5) { pdf.stroke_bounds }
22
+
23
+ pdf.text from[:name]
24
+ pdf.text from[:address_1]
25
+ pdf.text from[:address_2]
26
+ pdf.text from[:address_3]
27
+ end
28
+
29
+ pdf.bounding_box( [ 4*72, 2.5*72 ], width: 4*72, height: 2*72 ) do
30
+ # pdf.transparent(0.5) { pdf.stroke_bounds }
31
+
32
+ pdf.text to[:name]
33
+ pdf.text to[:address_1]
34
+ pdf.text to[:address_2]
35
+ pdf.text to[:address_3]
36
+ end
37
+
38
+ if idx+1 != props[:tos].length
39
+ pdf.start_new_page
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+
46
+ return pdf
47
+ end
48
+
49
+ end
50
+ ODE = ::Office::DirectmailEnvelope
51
+
@@ -178,7 +178,7 @@ class Office::EmailMessage
178
178
  ActionView::Base.full_sanitizer.sanitize( part_html||'' ).squish
179
179
  end
180
180
  def preview_str
181
- body.sanitized[0..200]
181
+ body_sanitized[0..200]
182
182
  end
183
183
 
184
184
 
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.297
4
+ version: 0.0.33.299
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -216,6 +216,7 @@ files:
216
216
  - lib/office/action.rb
217
217
  - lib/office/action_tie.rb
218
218
  - lib/office/admin_message.rb
219
+ - lib/office/directmail_envelope.rb
219
220
  - lib/office/email_action.rb
220
221
  - lib/office/email_action_tie.rb
221
222
  - lib/office/email_attachment.rb