aerogel-mailer 1.0.0 → 1.1.0

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
  SHA1:
3
- metadata.gz: 338b48b0e5fe4f6a72c29fcfe8ae28cc9b5c51a5
4
- data.tar.gz: f25e3c711d479d5cd373ebcbb5f543b2a7ec6262
3
+ metadata.gz: b5461c3ccd3a23a5eb4311143bf133402beed012
4
+ data.tar.gz: ea197664237c0c543823e0cbfe23c2c6a369b529
5
5
  SHA512:
6
- metadata.gz: 753dcaeb9a141af26c6ac8c2b452577965bc46231decaa45a133a3ed596bbf42687c185a07613e41b4e8ee353d1f7a626f5344ca7b39a955560e6257a270b4d4
7
- data.tar.gz: 97926b451efa64b7171325b16ed8c22761b17ac7b677abf186bcda3b49d9805c166fba10194111320c9f48f4e8358d3b51bad2ce37943d11f34574978358c46e
6
+ metadata.gz: 74a6afed5d27550f2d8f6d288395e0966c7ff37c6d2788079babcc9d193f82faab1da19d197d7e0a53446a7818ca875ae0ea0ef2f75450966889cd008c4b04db
7
+ data.tar.gz: d7dbe89851c5c3c1fd08885ba912e759768f0ff92a251c98e7fcda034eacb8cd46a3fc7fd9debb346f1394ac2b6fc5349cfeaf90bc45b862f7ca8aecac65fb9d
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .ruby-version
19
+ .ruby-gemset
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "aerogel-core"
21
+ spec.add_dependency "aerogel-core", "~> 1.4"
22
22
  spec.add_dependency "mail"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -1,7 +1,3 @@
1
- module Aerogel::Helpers
2
-
3
- def email( *args )
4
- Aerogel::Application.email( *args )
5
- end
6
-
7
- end # module Aerogel::Helpers
1
+ def email( *args )
2
+ Aerogel::Application.email_with_context( self, *args )
3
+ end
@@ -1,4 +1,4 @@
1
1
  mailer {
2
2
  delivery_method :test
3
- default_from 'noreply'
3
+ default_from "noreply"
4
4
  }
@@ -12,7 +12,13 @@ module Aerogel::Mailer
12
12
  end
13
13
 
14
14
  # load mailers
15
- Aerogel::require_resources( :app, "mailers/**/*.rb" )
15
+ Aerogel::get_resource_list( :app, "mailers/**/*.rb" ).each do |filename|
16
+ Aerogel.require_into( Aerogel::Application, filename )
17
+ end
18
+
19
+ # register reloader
20
+ setup_reloader(app) if Aerogel.config.aerogel.reloader?
21
+
16
22
  end
17
23
 
18
24
  # Registers new mailer
@@ -24,11 +30,17 @@ module Aerogel::Mailer
24
30
  # Deliver email using mailer specified by +name+
25
31
  #
26
32
  def email( name, *args )
33
+ email_with_context( self, name, *args )
34
+ end
35
+
36
+ # Deliver email using mailer specified by +name+
37
+ #
38
+ def email_with_context( context, name, *args )
27
39
  mailer = Aerogel::Mailer::Definition.mailers[name.to_sym]
28
40
  unless mailer
29
41
  raise ArgumentError.new "Mailer '#{name}' is not defined"
30
42
  end
31
- params = mailer.compile( *args )
43
+ params = mailer.compile( context, *args )
32
44
  puts "** sending mail: #{params}"
33
45
  begin
34
46
  message = Mail.new do
@@ -52,6 +64,22 @@ module Aerogel::Mailer
52
64
  true
53
65
  end
54
66
 
67
+ private
68
+
69
+ # Sets up reloader
70
+ #
71
+ def self.setup_reloader( app )
72
+ app.use Aerogel::Reloader, ->{ Aerogel.get_resource_list( :app, "mailers/**/*.rb" ) } do |files|
73
+ # reset mailers
74
+ Definition.mailers.clear
75
+
76
+ # load mailers
77
+ files.each do |filename|
78
+ Aerogel.require_into( Aerogel::Application, filename )
79
+ end
80
+ end
81
+ end
82
+
55
83
 
56
84
 
57
85
  end # module Aerogel::Mailer
@@ -78,14 +78,15 @@ class Definition
78
78
  params[:locals].merge! args
79
79
  end
80
80
 
81
- def compile( *args )
81
+ def compile( context, *args )
82
82
  unless args.size == blk.arity
83
83
  raise Aerogel::Mailer::Error.new("wrong number of arguments for mailer '#{name}': #{args.size} for #{blk.arity}")
84
84
  end
85
- @self_before_instance_eval = eval "self", blk.binding
85
+ # @self_before_instance_eval = eval "self", blk.binding
86
+ @self_before_instance_eval = context
86
87
  params.clear
87
88
  instance_exec( *args, &blk )
88
- params[:from] ||= config.mailer.default_from
89
+ params[:from] ||= config.mailer.default_from!
89
90
  if params[:from].nil?
90
91
  raise Aerogel::Mailer::Error.new("'from' address is not set for mailer '#{name}'")
91
92
  end
@@ -108,23 +109,33 @@ class Definition
108
109
 
109
110
  private
110
111
 
111
- # Returns template file name, use cached file name if possible.
112
- #
113
- def fetch_template_name( filename )
114
- @template_name_cache ||= {} # reset if reload templates is used
115
- return @template_name_cache[filename] unless @template_name_cache[filename].nil?
116
- if Aerogel.get_resource( :views, filename+".erb" )
117
- @template_name_cache[filename] = filename.to_sym
118
- else
119
- @template_name_cache[filename] = false # template not found
112
+ class TemplateNameCache
113
+ # Returns template file name, use cached file name if possible.
114
+ #
115
+ def self.fetch( filename )
116
+ @cache ||= {} # reset if reload templates is used
117
+ return @cache[filename] unless @cache[filename].nil?
118
+ if Aerogel.get_resource( :views, filename+".erb" )
119
+ @cache[filename] = filename.to_sym
120
+ else
121
+ @cache[filename] = false # template not found
122
+ end
123
+ @cache[filename]
120
124
  end
121
- @template_name_cache[filename]
122
- end
125
+
126
+ def self.clear
127
+ @cache = {}
128
+ end
129
+ end # class TemplateNameCache
123
130
 
124
131
  # Renders message body using filled params.
125
132
  # Stores rendered body (text and html parts) into params[:body] hash.
126
133
  #
127
134
  def render_body
135
+ if Aerogel.config.aerogel.reloader?
136
+ TemplateNameCache.clear
137
+ template_cache.clear
138
+ end
128
139
  params[:body] ||= {}
129
140
  return unless params[:body].blank? # body set in the mailer definition block
130
141
  if params[:layout] == false
@@ -132,11 +143,11 @@ private
132
143
  layout_html = false
133
144
  else
134
145
  layout_name = params[:layout] || DEFAULT_LAYOUT
135
- layout_text = fetch_template_name( "layouts/#{layout_name}.text" )
136
- layout_html = fetch_template_name( "layouts/#{layout_name}.html" )
146
+ layout_text = TemplateNameCache.fetch( "layouts/#{layout_name}.text" )
147
+ layout_html = TemplateNameCache.fetch( "layouts/#{layout_name}.html" )
137
148
  end
138
- body_text = fetch_template_name( "mailers/#{name}.text" )
139
- body_html = fetch_template_name( "mailers/#{name}.html" )
149
+ body_text = TemplateNameCache.fetch( "mailers/#{name}.text" )
150
+ body_html = TemplateNameCache.fetch( "mailers/#{name}.html" )
140
151
  if !body_text && !body_html
141
152
  raise Aerogel::Mailer::Error.new "No body templates found for mailer '#{name}'"
142
153
  end
@@ -1,5 +1,5 @@
1
1
  module Aerogel
2
2
  module Mailer
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -0,0 +1,795 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <meta name="viewport" content="width=device-width"/>
6
+ <style>
7
+ /**********************************************
8
+ * Ink v1.0.5 - Copyright 2013 ZURB Inc *
9
+ **********************************************/
10
+
11
+ /* Client-specific Styles & Reset */
12
+
13
+ #outlook a {
14
+ padding:0;
15
+ }
16
+
17
+ body{
18
+ width:100% !important;
19
+ min-width: 100%;
20
+ -webkit-text-size-adjust:100%;
21
+ -ms-text-size-adjust:100%;
22
+ margin:0;
23
+ padding:0;
24
+ }
25
+
26
+ .ExternalClass {
27
+ width:100%;
28
+ }
29
+
30
+ .ExternalClass,
31
+ .ExternalClass p,
32
+ .ExternalClass span,
33
+ .ExternalClass font,
34
+ .ExternalClass td,
35
+ .ExternalClass div {
36
+ line-height: 100%;
37
+ }
38
+
39
+ #backgroundTable {
40
+ margin:0;
41
+ padding:0;
42
+ width:100% !important;
43
+ line-height: 100% !important;
44
+ }
45
+
46
+ img {
47
+ outline:none;
48
+ text-decoration:none;
49
+ -ms-interpolation-mode: bicubic;
50
+ width: auto;
51
+ max-width: 100%;
52
+ float: left;
53
+ clear: both;
54
+ display: block;
55
+ }
56
+
57
+ center {
58
+ width: 100%;
59
+ min-width: 580px;
60
+ }
61
+
62
+ a img {
63
+ border: none;
64
+ }
65
+
66
+ p {
67
+ margin: 0 0 0 10px;
68
+ }
69
+
70
+ table {
71
+ border-spacing: 0;
72
+ border-collapse: collapse;
73
+ }
74
+
75
+ td {
76
+ word-break: break-word;
77
+ -webkit-hyphens: auto;
78
+ -moz-hyphens: auto;
79
+ hyphens: auto;
80
+ border-collapse: collapse !important;
81
+ }
82
+
83
+ table, tr, td {
84
+ padding: 0;
85
+ vertical-align: top;
86
+ text-align: left;
87
+ }
88
+
89
+ hr {
90
+ color: #d9d9d9;
91
+ background-color: #d9d9d9;
92
+ height: 1px;
93
+ border: none;
94
+ }
95
+
96
+ /* Responsive Grid */
97
+
98
+ table.body {
99
+ height: 100%;
100
+ width: 100%;
101
+ }
102
+
103
+ table.container {
104
+ width: 580px;
105
+ margin: 0 auto;
106
+ text-align: inherit;
107
+ }
108
+
109
+ table.row {
110
+ padding: 0px;
111
+ width: 100%;
112
+ position: relative;
113
+ }
114
+
115
+ table.container table.row {
116
+ display: block;
117
+ }
118
+
119
+ td.wrapper {
120
+ padding: 10px 20px 0px 0px;
121
+ position: relative;
122
+ }
123
+
124
+ table.columns,
125
+ table.column {
126
+ margin: 0 auto;
127
+ }
128
+
129
+ table.columns td,
130
+ table.column td {
131
+ padding: 0px 0px 10px;
132
+ }
133
+
134
+ table.columns td.sub-columns,
135
+ table.column td.sub-columns,
136
+ table.columns td.sub-column,
137
+ table.column td.sub-column {
138
+ padding-right: 10px;
139
+ }
140
+
141
+ td.sub-column, td.sub-columns {
142
+ min-width: 0px;
143
+ }
144
+
145
+ table.row td.last,
146
+ table.container td.last {
147
+ padding-right: 0px;
148
+ }
149
+
150
+ table.one { width: 30px; }
151
+ table.two { width: 80px; }
152
+ table.three { width: 130px; }
153
+ table.four { width: 180px; }
154
+ table.five { width: 230px; }
155
+ table.six { width: 280px; }
156
+ table.seven { width: 330px; }
157
+ table.eight { width: 380px; }
158
+ table.nine { width: 430px; }
159
+ table.ten { width: 480px; }
160
+ table.eleven { width: 530px; }
161
+ table.twelve { width: 580px; }
162
+
163
+ table.one center { min-width: 30px; }
164
+ table.two center { min-width: 80px; }
165
+ table.three center { min-width: 130px; }
166
+ table.four center { min-width: 180px; }
167
+ table.five center { min-width: 230px; }
168
+ table.six center { min-width: 280px; }
169
+ table.seven center { min-width: 330px; }
170
+ table.eight center { min-width: 380px; }
171
+ table.nine center { min-width: 430px; }
172
+ table.ten center { min-width: 480px; }
173
+ table.eleven center { min-width: 530px; }
174
+ table.twelve center { min-width: 580px; }
175
+
176
+ table.one .panel center { min-width: 10px; }
177
+ table.two .panel center { min-width: 60px; }
178
+ table.three .panel center { min-width: 110px; }
179
+ table.four .panel center { min-width: 160px; }
180
+ table.five .panel center { min-width: 210px; }
181
+ table.six .panel center { min-width: 260px; }
182
+ table.seven .panel center { min-width: 310px; }
183
+ table.eight .panel center { min-width: 360px; }
184
+ table.nine .panel center { min-width: 410px; }
185
+ table.ten .panel center { min-width: 460px; }
186
+ table.eleven .panel center { min-width: 510px; }
187
+ table.twelve .panel center { min-width: 560px; }
188
+
189
+ .body .columns td.one,
190
+ .body .column td.one { width: 8.333333%; }
191
+ .body .columns td.two,
192
+ .body .column td.two { width: 16.666666%; }
193
+ .body .columns td.three,
194
+ .body .column td.three { width: 25%; }
195
+ .body .columns td.four,
196
+ .body .column td.four { width: 33.333333%; }
197
+ .body .columns td.five,
198
+ .body .column td.five { width: 41.666666%; }
199
+ .body .columns td.six,
200
+ .body .column td.six { width: 50%; }
201
+ .body .columns td.seven,
202
+ .body .column td.seven { width: 58.333333%; }
203
+ .body .columns td.eight,
204
+ .body .column td.eight { width: 66.666666%; }
205
+ .body .columns td.nine,
206
+ .body .column td.nine { width: 75%; }
207
+ .body .columns td.ten,
208
+ .body .column td.ten { width: 83.333333%; }
209
+ .body .columns td.eleven,
210
+ .body .column td.eleven { width: 91.666666%; }
211
+ .body .columns td.twelve,
212
+ .body .column td.twelve { width: 100%; }
213
+
214
+ td.offset-by-one { padding-left: 50px; }
215
+ td.offset-by-two { padding-left: 100px; }
216
+ td.offset-by-three { padding-left: 150px; }
217
+ td.offset-by-four { padding-left: 200px; }
218
+ td.offset-by-five { padding-left: 250px; }
219
+ td.offset-by-six { padding-left: 300px; }
220
+ td.offset-by-seven { padding-left: 350px; }
221
+ td.offset-by-eight { padding-left: 400px; }
222
+ td.offset-by-nine { padding-left: 450px; }
223
+ td.offset-by-ten { padding-left: 500px; }
224
+ td.offset-by-eleven { padding-left: 550px; }
225
+
226
+ td.expander {
227
+ visibility: hidden;
228
+ width: 0px;
229
+ padding: 0 !important;
230
+ }
231
+
232
+ table.columns .text-pad,
233
+ table.column .text-pad {
234
+ padding-left: 10px;
235
+ padding-right: 10px;
236
+ }
237
+
238
+ table.columns .left-text-pad,
239
+ table.columns .text-pad-left,
240
+ table.column .left-text-pad,
241
+ table.column .text-pad-left {
242
+ padding-left: 10px;
243
+ }
244
+
245
+ table.columns .right-text-pad,
246
+ table.columns .text-pad-right,
247
+ table.column .right-text-pad,
248
+ table.column .text-pad-right {
249
+ padding-right: 10px;
250
+ }
251
+
252
+ /* Block Grid */
253
+
254
+ .block-grid {
255
+ width: 100%;
256
+ max-width: 580px;
257
+ }
258
+
259
+ .block-grid td {
260
+ display: inline-block;
261
+ padding:10px;
262
+ }
263
+
264
+ .two-up td {
265
+ width:270px;
266
+ }
267
+
268
+ .three-up td {
269
+ width:173px;
270
+ }
271
+
272
+ .four-up td {
273
+ width:125px;
274
+ }
275
+
276
+ .five-up td {
277
+ width:96px;
278
+ }
279
+
280
+ .six-up td {
281
+ width:76px;
282
+ }
283
+
284
+ .seven-up td {
285
+ width:62px;
286
+ }
287
+
288
+ .eight-up td {
289
+ width:52px;
290
+ }
291
+
292
+ /* Alignment & Visibility Classes */
293
+
294
+ table.center, td.center {
295
+ text-align: center;
296
+ }
297
+
298
+ h1.center,
299
+ h2.center,
300
+ h3.center,
301
+ h4.center,
302
+ h5.center,
303
+ h6.center {
304
+ text-align: center;
305
+ }
306
+
307
+ span.center {
308
+ display: block;
309
+ width: 100%;
310
+ text-align: center;
311
+ }
312
+
313
+ img.center {
314
+ margin: 0 auto;
315
+ float: none;
316
+ }
317
+
318
+ .show-for-small,
319
+ .hide-for-desktop {
320
+ display: none;
321
+ }
322
+
323
+ /* Typography */
324
+
325
+ body, table.body, h1, h2, h3, h4, h5, h6, p, td {
326
+ color: #222222;
327
+ font-family: "Helvetica", "Arial", sans-serif;
328
+ font-weight: normal;
329
+ padding:0;
330
+ margin: 0;
331
+ text-align: left;
332
+ line-height: 1.3;
333
+ }
334
+
335
+ h1, h2, h3, h4, h5, h6 {
336
+ word-break: normal;
337
+ }
338
+
339
+ h1 {font-size: 40px;}
340
+ h2 {font-size: 36px;}
341
+ h3 {font-size: 32px;}
342
+ h4 {font-size: 28px;}
343
+ h5 {font-size: 24px;}
344
+ h6 {font-size: 20px;}
345
+ body, table.body, p, td {font-size: 14px;line-height:19px;}
346
+
347
+ p.lead, p.lede, p.leed {
348
+ font-size: 18px;
349
+ line-height:21px;
350
+ }
351
+
352
+ p {
353
+ margin-bottom: 10px;
354
+ }
355
+
356
+ small {
357
+ font-size: 10px;
358
+ }
359
+
360
+ a {
361
+ color: #2ba6cb;
362
+ text-decoration: none;
363
+ }
364
+
365
+ a:hover {
366
+ color: #2795b6 !important;
367
+ }
368
+
369
+ a:active {
370
+ color: #2795b6 !important;
371
+ }
372
+
373
+ a:visited {
374
+ color: #2ba6cb !important;
375
+ }
376
+
377
+ h1 a,
378
+ h2 a,
379
+ h3 a,
380
+ h4 a,
381
+ h5 a,
382
+ h6 a {
383
+ color: #2ba6cb;
384
+ }
385
+
386
+ h1 a:active,
387
+ h2 a:active,
388
+ h3 a:active,
389
+ h4 a:active,
390
+ h5 a:active,
391
+ h6 a:active {
392
+ color: #2ba6cb !important;
393
+ }
394
+
395
+ h1 a:visited,
396
+ h2 a:visited,
397
+ h3 a:visited,
398
+ h4 a:visited,
399
+ h5 a:visited,
400
+ h6 a:visited {
401
+ color: #2ba6cb !important;
402
+ }
403
+
404
+ /* Panels */
405
+
406
+ .panel {
407
+ background: #f2f2f2;
408
+ border: 1px solid #d9d9d9;
409
+ padding: 10px !important;
410
+ }
411
+
412
+ .sub-grid table {
413
+ width: 100%;
414
+ }
415
+
416
+ .sub-grid td.sub-columns {
417
+ padding-bottom: 0;
418
+ }
419
+
420
+ /* Buttons */
421
+
422
+ table.button,
423
+ table.tiny-button,
424
+ table.small-button,
425
+ table.medium-button,
426
+ table.large-button {
427
+ width: 100%;
428
+ overflow: hidden;
429
+ }
430
+
431
+ table.button td,
432
+ table.tiny-button td,
433
+ table.small-button td,
434
+ table.medium-button td,
435
+ table.large-button td {
436
+ display: block;
437
+ width: auto !important;
438
+ text-align: center;
439
+ background: #2ba6cb;
440
+ border: 1px solid #2284a1;
441
+ color: #ffffff;
442
+ padding: 8px 0;
443
+ }
444
+
445
+ table.tiny-button td {
446
+ padding: 5px 0 4px;
447
+ }
448
+
449
+ table.small-button td {
450
+ padding: 8px 0 7px;
451
+ }
452
+
453
+ table.medium-button td {
454
+ padding: 12px 0 10px;
455
+ }
456
+
457
+ table.large-button td {
458
+ padding: 21px 0 18px;
459
+ }
460
+
461
+ table.button td a,
462
+ table.tiny-button td a,
463
+ table.small-button td a,
464
+ table.medium-button td a,
465
+ table.large-button td a {
466
+ font-weight: bold;
467
+ text-decoration: none;
468
+ font-family: Helvetica, Arial, sans-serif;
469
+ color: #ffffff;
470
+ font-size: 16px;
471
+ }
472
+
473
+ table.tiny-button td a {
474
+ font-size: 12px;
475
+ font-weight: normal;
476
+ }
477
+
478
+ table.small-button td a {
479
+ font-size: 16px;
480
+ }
481
+
482
+ table.medium-button td a {
483
+ font-size: 20px;
484
+ }
485
+
486
+ table.large-button td a {
487
+ font-size: 24px;
488
+ }
489
+
490
+ table.button:hover td,
491
+ table.button:visited td,
492
+ table.button:active td {
493
+ background: #2795b6 !important;
494
+ }
495
+
496
+ table.button:hover td a,
497
+ table.button:visited td a,
498
+ table.button:active td a {
499
+ color: #fff !important;
500
+ }
501
+
502
+ table.button:hover td,
503
+ table.tiny-button:hover td,
504
+ table.small-button:hover td,
505
+ table.medium-button:hover td,
506
+ table.large-button:hover td {
507
+ background: #2795b6 !important;
508
+ }
509
+
510
+ table.button:hover td a,
511
+ table.button:active td a,
512
+ table.button td a:visited,
513
+ table.tiny-button:hover td a,
514
+ table.tiny-button:active td a,
515
+ table.tiny-button td a:visited,
516
+ table.small-button:hover td a,
517
+ table.small-button:active td a,
518
+ table.small-button td a:visited,
519
+ table.medium-button:hover td a,
520
+ table.medium-button:active td a,
521
+ table.medium-button td a:visited,
522
+ table.large-button:hover td a,
523
+ table.large-button:active td a,
524
+ table.large-button td a:visited {
525
+ color: #ffffff !important;
526
+ }
527
+
528
+ table.secondary td {
529
+ background: #e9e9e9;
530
+ border-color: #d0d0d0;
531
+ color: #555;
532
+ }
533
+
534
+ table.secondary td a {
535
+ color: #555;
536
+ }
537
+
538
+ table.secondary:hover td {
539
+ background: #d0d0d0 !important;
540
+ color: #555;
541
+ }
542
+
543
+ table.secondary:hover td a,
544
+ table.secondary td a:visited,
545
+ table.secondary:active td a {
546
+ color: #555 !important;
547
+ }
548
+
549
+ table.success td {
550
+ background: #5da423;
551
+ border-color: #457a1a;
552
+ }
553
+
554
+ table.success:hover td {
555
+ background: #457a1a !important;
556
+ }
557
+
558
+ table.alert td {
559
+ background: #c60f13;
560
+ border-color: #970b0e;
561
+ }
562
+
563
+ table.alert:hover td {
564
+ background: #970b0e !important;
565
+ }
566
+
567
+ table.radius td {
568
+ -webkit-border-radius: 3px;
569
+ -moz-border-radius: 3px;
570
+ border-radius: 3px;
571
+ }
572
+
573
+ table.round td {
574
+ -webkit-border-radius: 500px;
575
+ -moz-border-radius: 500px;
576
+ border-radius: 500px;
577
+ }
578
+
579
+ /* Outlook First */
580
+
581
+ body.outlook p {
582
+ display: inline !important;
583
+ }
584
+
585
+ /* Media Queries */
586
+
587
+ @media only screen and (max-width: 600px) {
588
+
589
+ table[class="body"] img {
590
+ width: auto !important;
591
+ height: auto !important;
592
+ }
593
+
594
+ table[class="body"] center {
595
+ min-width: 0 !important;
596
+ }
597
+
598
+ table[class="body"] .container {
599
+ width: 95% !important;
600
+ }
601
+
602
+ table[class="body"] .row {
603
+ width: 100% !important;
604
+ display: block !important;
605
+ }
606
+
607
+ table[class="body"] .wrapper {
608
+ display: block !important;
609
+ padding-right: 0 !important;
610
+ }
611
+
612
+ table[class="body"] .columns,
613
+ table[class="body"] .column {
614
+ table-layout: fixed !important;
615
+ float: none !important;
616
+ width: 100% !important;
617
+ padding-right: 0px !important;
618
+ padding-left: 0px !important;
619
+ display: block !important;
620
+ }
621
+
622
+ table[class="body"] .wrapper.first .columns,
623
+ table[class="body"] .wrapper.first .column {
624
+ display: table !important;
625
+ }
626
+
627
+ table[class="body"] table.columns td,
628
+ table[class="body"] table.column td {
629
+ width: 100% !important;
630
+ }
631
+
632
+ table[class="body"] .columns td.one,
633
+ table[class="body"] .column td.one { width: 8.333333% !important; }
634
+ table[class="body"] .columns td.two,
635
+ table[class="body"] .column td.two { width: 16.666666% !important; }
636
+ table[class="body"] .columns td.three,
637
+ table[class="body"] .column td.three { width: 25% !important; }
638
+ table[class="body"] .columns td.four,
639
+ table[class="body"] .column td.four { width: 33.333333% !important; }
640
+ table[class="body"] .columns td.five,
641
+ table[class="body"] .column td.five { width: 41.666666% !important; }
642
+ table[class="body"] .columns td.six,
643
+ table[class="body"] .column td.six { width: 50% !important; }
644
+ table[class="body"] .columns td.seven,
645
+ table[class="body"] .column td.seven { width: 58.333333% !important; }
646
+ table[class="body"] .columns td.eight,
647
+ table[class="body"] .column td.eight { width: 66.666666% !important; }
648
+ table[class="body"] .columns td.nine,
649
+ table[class="body"] .column td.nine { width: 75% !important; }
650
+ table[class="body"] .columns td.ten,
651
+ table[class="body"] .column td.ten { width: 83.333333% !important; }
652
+ table[class="body"] .columns td.eleven,
653
+ table[class="body"] .column td.eleven { width: 91.666666% !important; }
654
+ table[class="body"] .columns td.twelve,
655
+ table[class="body"] .column td.twelve { width: 100% !important; }
656
+
657
+ table[class="body"] td.offset-by-one,
658
+ table[class="body"] td.offset-by-two,
659
+ table[class="body"] td.offset-by-three,
660
+ table[class="body"] td.offset-by-four,
661
+ table[class="body"] td.offset-by-five,
662
+ table[class="body"] td.offset-by-six,
663
+ table[class="body"] td.offset-by-seven,
664
+ table[class="body"] td.offset-by-eight,
665
+ table[class="body"] td.offset-by-nine,
666
+ table[class="body"] td.offset-by-ten,
667
+ table[class="body"] td.offset-by-eleven {
668
+ padding-left: 0 !important;
669
+ }
670
+
671
+ table[class="body"] table.columns td.expander {
672
+ width: 1px !important;
673
+ }
674
+
675
+ table[class="body"] .right-text-pad,
676
+ table[class="body"] .text-pad-right {
677
+ padding-left: 10px !important;
678
+ }
679
+
680
+ table[class="body"] .left-text-pad,
681
+ table[class="body"] .text-pad-left {
682
+ padding-right: 10px !important;
683
+ }
684
+
685
+ table[class="body"] .hide-for-small,
686
+ table[class="body"] .show-for-desktop {
687
+ display: none !important;
688
+ }
689
+
690
+ table[class="body"] .show-for-small,
691
+ table[class="body"] .hide-for-desktop {
692
+ display: inherit !important;
693
+ }
694
+ }
695
+
696
+ </style>
697
+ <style>
698
+
699
+ table.facebook td {
700
+ background: #3b5998;
701
+ border-color: #2d4473;
702
+ }
703
+
704
+ table.facebook:hover td {
705
+ background: #2d4473 !important;
706
+ }
707
+
708
+ table.twitter td {
709
+ background: #00acee;
710
+ border-color: #0087bb;
711
+ }
712
+
713
+ table.twitter:hover td {
714
+ background: #0087bb !important;
715
+ }
716
+
717
+ table.google-plus td {
718
+ background-color: #DB4A39;
719
+ border-color: #CC0000;
720
+ }
721
+
722
+ table.google-plus:hover td {
723
+ background: #CC0000 !important;
724
+ }
725
+
726
+ .template-label {
727
+ color: #ffffff;
728
+ font-weight: bold;
729
+ font-size: 11px;
730
+ }
731
+
732
+ .callout .wrapper {
733
+ padding-bottom: 20px;
734
+ }
735
+
736
+ .callout .panel {
737
+ background: #ECF8FF;
738
+ border-color: #b9e5ff;
739
+ }
740
+
741
+ .header {
742
+ background: #999999;
743
+ }
744
+
745
+ .footer .wrapper {
746
+ background: #ebebeb;
747
+ }
748
+
749
+ .footer h5 {
750
+ padding-bottom: 10px;
751
+ }
752
+
753
+ table.columns .text-pad {
754
+ padding-left: 10px;
755
+ padding-right: 10px;
756
+ }
757
+
758
+ table.columns .left-text-pad {
759
+ padding-left: 10px;
760
+ }
761
+
762
+ table.columns .right-text-pad {
763
+ padding-right: 10px;
764
+ }
765
+
766
+ @media only screen and (max-width: 600px) {
767
+
768
+ table[class="body"] .right-text-pad {
769
+ padding-left: 10px !important;
770
+ }
771
+
772
+ table[class="body"] .left-text-pad {
773
+ padding-right: 10px !important;
774
+ }
775
+ }
776
+
777
+ </style>
778
+ </head>
779
+ <body>
780
+ <table class="body">
781
+ <tr>
782
+ <td class="center" align="center" valign="top">
783
+ <center>
784
+
785
+ <%= yield %>
786
+
787
+ </center>
788
+ </td>
789
+ </tr>
790
+ </table>
791
+ </body>
792
+ </html>
793
+
794
+
795
+
@@ -0,0 +1,4 @@
1
+
2
+ <%= yield %>
3
+
4
+ ---
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aerogel-mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kukushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aerogel-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mail
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Mail sending for aerogel applications
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - Gemfile
78
78
  - LICENSE.txt
79
79
  - README.md
@@ -88,6 +88,8 @@ files:
88
88
  - lib/aerogel/mailer/definition.rb
89
89
  - lib/aerogel/mailer/error.rb
90
90
  - lib/aerogel/mailer/version.rb
91
+ - views/layouts/mailer.html.erb
92
+ - views/layouts/mailer.text.erb
91
93
  homepage: https://github.com/kukushkin/aerogel-mailer
92
94
  licenses:
93
95
  - MIT
@@ -98,17 +100,17 @@ require_paths:
98
100
  - lib
99
101
  required_ruby_version: !ruby/object:Gem::Requirement
100
102
  requirements:
101
- - - '>='
103
+ - - ">="
102
104
  - !ruby/object:Gem::Version
103
105
  version: '0'
104
106
  required_rubygems_version: !ruby/object:Gem::Requirement
105
107
  requirements:
106
- - - '>='
108
+ - - ">="
107
109
  - !ruby/object:Gem::Version
108
110
  version: '0'
109
111
  requirements: []
110
112
  rubyforge_project:
111
- rubygems_version: 2.0.6
113
+ rubygems_version: 2.2.2
112
114
  signing_key:
113
115
  specification_version: 4
114
116
  summary: Mail sending for aerogel applications