fx_awesome_mails 0.5.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 375f8fa975dff9c07d12784b3439f6a74c88f8f1a49a85842e48bfa77a2961dd
4
+ data.tar.gz: 777a1952abc39060e94a0a4543b4f1d6ebb114563684b5f3cae21f9357c98bcc
5
+ SHA512:
6
+ metadata.gz: e43af4e3a804d65197a058eb0a43353174c5804da05717e2bdcb4e113da3c0fc5903cf4315f8d9c3f10597b18ace97f4c585bbbbeffe909bdf3c3b83afeb8557
7
+ data.tar.gz: a359826ca588ecacca6638d98351b34e7a3f02331817ec19083719bd2529216db4e06b3c22c47f2aaaea12826c935f25cca95e6dd64f640fb2c88289d5177e87
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # FXAwesomeMails
2
+ Provides various view helpers for cross client mail creation.
3
+
4
+ ## Usage
5
+
6
+ use the various view helpers in the .erb file of your mail
7
+
8
+ ## Installation
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'fx_awesome_mails'
13
+ ```
14
+
15
+ And then execute:
16
+ ```bash
17
+ $ bundle
18
+ ```
19
+
20
+ Or install it yourself as:
21
+ ```bash
22
+ $ gem install fx_awesome_mails
23
+ ```
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require "bundler/setup"
2
+
3
+ require "bundler/gem_tasks"
4
+
5
+ require "rake/testtask"
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs << 'test'
9
+ t.pattern = 'test/**/*_test.rb'
10
+ t.verbose = false
11
+ end
12
+
13
+ task default: :test
@@ -0,0 +1,14 @@
1
+ module FXAwesomeMails
2
+ class Railtie < ::Rails::Railtie
3
+ initializer "fx_awesome_mails.view_helpers" do
4
+ ActiveSupport.on_load(:action_view) { include FXAwesomeMails::EmailHelpers }
5
+ end
6
+ end
7
+ end
8
+
9
+ # module FXAwesomeMails
10
+ # module Rails
11
+ # class Engine < ::Rails::Engine
12
+ # end
13
+ # end
14
+ # end
@@ -0,0 +1,3 @@
1
+ module FXAwesomeMails
2
+ VERSION = '0.5.0'
3
+ end
@@ -0,0 +1,423 @@
1
+ module FXAwesomeMails
2
+ module EmailHelpers
3
+ def preheader(text)
4
+ "<div style='display: none; max-height: 0px; overflow: hidden;'>
5
+ #{text}
6
+ </div>
7
+ <div class='preheader' style='display: none; width: 0px; height: 0px; max-height: 0px; overflow: hidden;'>
8
+ &#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;
9
+ </div>".html_safe
10
+ end
11
+
12
+ def titlebar_link(link)
13
+ "<div class='tac pt10 pb10 pl5 pr5'>
14
+ <!--[if gte mso 12]><br><![endif]-->
15
+ #{link}
16
+ <!--[if gte mso 12]><br><![endif]-->
17
+ </div>".html_safe
18
+ end
19
+
20
+ def divider(options = {})
21
+ "<p class='MsoNormal'><o:p>&nbsp;</o:p></p>".html_safe # TODO: options/smaller
22
+ end
23
+
24
+
25
+ # experimental mail helpers
26
+ def content_tag_if(condition, name, content_or_options_with_block = {}, options = {}, escape = true, &block)
27
+ options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash) if block_given?
28
+ options.each do |option, values|
29
+ options[option] = case values
30
+ when Array then values.send(condition ? "first" : "last")
31
+ when Hash then ((values[:if] && values[:else]) ? values[(condition ? :if : :else)] : values.to_s)
32
+ else values.to_s
33
+ end
34
+ end
35
+ content_or_options_with_block, options = options, nil if block_given?
36
+ content_tag(name, content_or_options_with_block, options, escape, &block)
37
+ end
38
+
39
+ def rounded_box(&block)
40
+ html = "<div class='rounded_box'><div class='rounded_box_content'><div class='rounded_box_top'></div>"
41
+ html << capture(:foo, :bar, &block)
42
+ html << "<div class='rounded_box_bottom'><div></div></div></div>"
43
+ raw html
44
+ end
45
+
46
+ # https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to_if + link_to( ...&block)
47
+ def link_to_if_true(condition, name, options = {}, html_options = {}, &block)
48
+ if condition
49
+ link_to(name, options, html_options, &block)
50
+ else
51
+ if block_given?
52
+ block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block)
53
+ else
54
+ ERB::Util.html_escape(name)
55
+ end
56
+ end
57
+ end
58
+
59
+ class Button
60
+ attr_accessor :parent
61
+ def initialize(parent)
62
+ self.parent = parent
63
+ end
64
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
65
+
66
+ # simple, graphical
67
+ def simple_button(text = nil, type: :simple, **options, &block)
68
+ html = "<th valign='bottom' style='text-align:left' class='buttoncellclass mobile-display-block button-container' bgcolor='#000000'>
69
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='width:100% !important' role='presentation'>
70
+ <tbody>
71
+ <tr>
72
+ <th valign='top'>
73
+ <table cellpadding='0' cellspacing='0' border='0' width='auto' style='margin:0 auto' role='presentation' align='center'>
74
+ <tbody>
75
+ <tr>"
76
+
77
+ # style = mso-line-height-rule: exactly; -webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;background:#FFFF00;text-align:right
78
+ # link_style = -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; padding: 10px 20px; display: inline-block; text-decoration: none; text-align: right; color: #00FF00; border: 12; font-family: Arial, sans-serif; font-size: 13px; line-height: 14px; font-weight: 500;
79
+ html << content_tag('th', valign: options[:valign].to_s, align: options[:align].to_s) do
80
+ link_to_if_true(options[:link_to_url].present?, options[:link_to_url].presence, target: '_blank') do
81
+ "#{block_given? ? capture(&block) : text}".html_safe
82
+ end
83
+ end
84
+
85
+ html << "</tr>
86
+ </tbody>
87
+ </table>
88
+ </th>
89
+ </tr>
90
+ </tbody>
91
+ </table>
92
+ </th>"
93
+
94
+ html.html_safe
95
+ end
96
+
97
+ def graphical_button(text, type: :simple, **options, &block)
98
+ "<th valign='bottom' style='text-align:left' class='buttoncellclass mobile-display-block button-container' bgcolor='#000000'>
99
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='width:100% !important' role='presentation'>
100
+ <tbody>
101
+ <tr>
102
+
103
+
104
+
105
+ </tr>
106
+ </tbody>
107
+ </table>
108
+ </th>"
109
+ end
110
+
111
+ def button(text = nil, type: :simple, **options)
112
+ case type
113
+ when :simple
114
+ simple_button(text, **options)
115
+ when :graphical
116
+ graphical_button(text, **options)
117
+ end
118
+ end
119
+
120
+ end
121
+ class Gutter
122
+ attr_accessor :parent
123
+ def initialize(parent)
124
+ self.parent = parent
125
+ end
126
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
127
+
128
+ def horizontal(height = '20', **options)
129
+ options = {valign: 'top', class: '',style: { "background-color" => '' }}.deep_merge_v2(options)
130
+ content_tag('th', '&nbsp;'.html_safe, height: height, valign: "#{options[:valign]}", style: "#{options[:style]}", class: "#{options[:class]} horizontal-gutter", bgcolor: "#{options.dig(:style, "background-color")}")
131
+ end
132
+
133
+ def vertical(width = '20', **options)
134
+ options = {valign: 'top', class: '',style: { "background-color" => '' }}.deep_merge_v2(options)
135
+ content_tag('th', '&nbsp;'.html_safe, width: width, valign: "#{options[:valign]}", style: "#{options[:style]}", class: "#{options[:class]} vertical-gutter", bgcolor: "#{options.dig(:style, "background-color")}")
136
+ end
137
+ end
138
+
139
+ class Text
140
+ attr_accessor :parent
141
+ def initialize(parent)
142
+ self.parent = parent
143
+ end
144
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
145
+
146
+ def text(text = nil, **options, &block)
147
+ options = {"mso-line-height-rule" => "exactly", "text-align" => "center", "font-family" => "Helvetica", "font-size" => "20px", "line-height" => "30px", "font-weight" => "400", color: "#000000", "background-color" => "#FF00FF"}.deep_merge_v2(options)
148
+ content_tag('th', valign: "#{options[:valign]}", style: options[:style], class: "#{options[:class]} text-container", bgcolor: "#{options.dig(:style, "background-color")}") do
149
+ "#{block_given? ? capture(&block) : text}".html_safe
150
+ end
151
+ end
152
+ end
153
+
154
+ class Image
155
+ attr_accessor :parent
156
+ def initialize(parent)
157
+ self.parent = parent
158
+ end
159
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
160
+
161
+ def email_image_tag(source: nil, **options, &block)
162
+ options = {alt: '', link_url: nil, width: 130, height: 50, valign: 'top', align: 'left', class: '', style: {"background-color" => "#FFFFFF", outline: "none", "text-decoration" => "none", "-ms-interpolation-mode" => "bicubic", display: "block", border: "none"} }.deep_merge_v2(options)
163
+ html = "<th valign='#{options[:avlign]}' style='text-align:left' class='#{options[:class]} mobile-display-table-footer-group image-container' bgcolor='#{options.dig(:style, "background-color")}' align='#{options[:align]}'>"
164
+ html << link_to_if_true(options[:link_url].present?, options[:link_url], target: '_blank') do
165
+ image_tag(source, style: options[:style], width: "#{options[:width]}", height: "#{options[:height]}", alt: "#{options[:alt]}")
166
+ end
167
+ html << "</th>"
168
+
169
+ html.html_safe
170
+ end
171
+ end
172
+
173
+
174
+ class VerticalGrid
175
+ attr_accessor :parent
176
+ def initialize(parent)
177
+ self.parent = parent
178
+ end
179
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
180
+
181
+ def self.vertical_grid(_capture_helper, **options, &block)
182
+ "<th valign='top' style='text-align:left' class='vertical-grid'>
183
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
184
+ <tbody>
185
+ #{_capture_helper.capture(VerticalGrid.new(_capture_helper), &block)}
186
+ </tbody>
187
+ </table>
188
+ </th>".html_safe
189
+ end
190
+
191
+ def gutter(...)
192
+ "<tr>#{Gutter.new(parent).horizontal(...)}</tr>".html_safe
193
+ end
194
+
195
+ def text(text = nil, **options, &block)
196
+ "<tr>#{Text.new(parent).text(text, **options, &block)}</tr>".html_safe
197
+ end
198
+
199
+ def image(...)
200
+ "<tr>#{Image.new(parent).email_image_tag(...)}</tr>".html_safe
201
+ end
202
+
203
+ def button(...)
204
+ "<tr>
205
+ #{Button.new(parent).button(...)}
206
+ </tr>".html_safe
207
+ end
208
+
209
+ def horizontal_grid(**options, &block)
210
+ "<tr>#{HorizontalGrid.horizontal_grid(parent, **options, &block)}</tr>".html_safe
211
+ end
212
+
213
+ def vertical_grid(**options, &block)
214
+ "<tr>#{VerticalGrid.vertical_grid(parent, **options, &block)}</tr>".html_safe
215
+ end
216
+ end
217
+
218
+
219
+ class HorizontalGrid
220
+ attr_accessor :parent
221
+ def initialize(parent)
222
+ self.parent = parent
223
+ end
224
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
225
+
226
+ def self.horizontal_grid(_capture_helper, **options, &block)
227
+ "<th valign='top' style='text-align:left' class='horizontal-grid'>
228
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
229
+ <tbody>
230
+ <tr>
231
+ #{_capture_helper.capture(HorizontalGrid.new(_capture_helper), &block)}
232
+ </tr>
233
+ </tbody>
234
+ </table>
235
+ </th>".html_safe
236
+ end
237
+
238
+ def gutter(...)
239
+ "#{Gutter.new(parent).vertical(...)}".html_safe
240
+ end
241
+
242
+ def text(text = nil, **options, &block)
243
+ options = { valign: 'top', style: { "mso-line-height-rule" => "exactly", "text-align" => "left", "font-family" => "Arial, sans-serif", "font-size" => "15px", "line-height" => "18px", "font-weight" => "normal", color: "#999999" }}.deep_merge_v2(options)
244
+ content_tag('th', valign: "#{options[:valign]}", style: "#{options[:style]}", class: "#{options[:class]} text-container") do
245
+ block_given? ? capture(&block) : text
246
+ end
247
+ end
248
+
249
+ def image(...)
250
+ "#{Image.new(parent).email_image_tag(...)}".html_safe
251
+ end
252
+
253
+ def button
254
+ "<th valign='top' style='text-align:left' class='button-container'>
255
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='width:100% !important' role='presentation'>
256
+ <tbody>
257
+ <tr>
258
+ <th valign='top'>
259
+ <table cellpadding='0' cellspacing='0' border='0' width='auto' role='presentation' align='left'>
260
+ <tbody>
261
+ <tr>
262
+ <th valign='middle' style='mso-line-height-rule: exactly; -webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background:#444444;text-align:left' align='left'><a style='-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding: 10px 20px; display: inline-block; text-decoration: none; text-align: left; color: #FFFFFF; border: 1px solid #444444; font-family: Arial, sans-serif; font-size: 15px; line-height: 18px; font-weight: normal;' href='#' target='_blank'>Click here</a></th>
263
+ </tr>
264
+ </tbody>
265
+ </table>
266
+ </th>
267
+ </tr>
268
+ </tbody>
269
+ </table>
270
+ </th>".hmtl_safe
271
+ end
272
+
273
+ def horizontal_grid(**options, &block)
274
+ "#{HorizontalGrid.horizontal_grid(parent, **options, &block)}".html_safe
275
+ end
276
+
277
+ def vertical_grid(**options, &block)
278
+ "#{VerticalGrid.vertical_grid(parent, **options, &block)}".html_safe
279
+ end
280
+
281
+ end
282
+
283
+ class ContentTable
284
+
285
+ attr_accessor :parent
286
+ def initialize(parent)
287
+ self.parent = parent
288
+ end
289
+ delegate :capture, :content_tag, :link_to, :link_to_if, :link_to_if_true, :image_tag, :to => :parent
290
+
291
+ def self.content_table(_capture_helper, **options, &block)
292
+ options = {alt: '', link_url: nil, width: 600, height: 50, valign: 'top', align: 'left', class: '', background: '', style: {"background-color" => "#FFFFFF" } }.deep_merge_v2(options)
293
+ "<table cellpadding='0' cellspacing='0' border='0' width='#{options[:width]}' style='margin: 0; padding: 0; text-align: left; width: 100%; min-width: 600px; line-height: 100%;' role='presentation' background='#{options[:background]}' class='background-table has-width-#{options[:width]}' bgcolor='#{options.dig(:style, "background-color")}' valign='top'>
294
+ <tbody>
295
+ <tr>
296
+ <th valign='top'>
297
+ <table cellpadding='0' cellspacing='0' border='0' width='#{options[:width]}' style='width:#{options[:width]}px;margin:0 auto' role='presentation' class='#{options[:class]} email-content' align='center'>
298
+ <tbody>
299
+ <tr>
300
+ <th valign='top'>
301
+ <div>
302
+ #{_capture_helper.capture(ContentTable.new(_capture_helper), &block)}
303
+ </div>
304
+ </th>
305
+ </tr>
306
+ </tbody>
307
+ </table>
308
+ </th>
309
+ </tr>
310
+ </tbody>
311
+ </table>".html_safe
312
+ end
313
+
314
+ def text(...)
315
+ "<div>
316
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
317
+ <tbody>
318
+ <tr>
319
+ #{Text.new(parent).text(...)}
320
+ </tr>
321
+ </tbody>
322
+ </table>
323
+ </div>".html_safe
324
+ end
325
+
326
+ def image(...)
327
+ "<div>
328
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
329
+ <tbody>
330
+ <tr>
331
+ #{Image.new(parent).email_image_tag(...)}
332
+ </tr>
333
+ </tbody>
334
+ </table>
335
+ </div>".html_safe
336
+ end
337
+
338
+ def button
339
+ "<div>
340
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
341
+ <tbody>
342
+ <tr>
343
+
344
+ <th valign='top' style='text-align:left' class='button-container'>
345
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='width:100% !important' role='presentation'>
346
+ <tbody>
347
+ <tr>
348
+ <th valign='top'>
349
+ <table cellpadding='0' cellspacing='0' border='0' width='auto' role='presentation' align='left'>
350
+ <tbody>
351
+ <tr>
352
+ <th valign='middle' style='mso-line-height-rule: exactly; -webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background:#444444;text-align:left' align='left'><a style='-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding: 10px 20px; display: inline-block; text-decoration: none; text-align: left; color: #FFFFFF; border: 1px solid #444444; font-family: Arial, sans-serif; font-size: 15px; line-height: 18px; font-weight: normal;' href='#' target='_blank'>Click here</a></th>
353
+ </tr>
354
+ </tbody>
355
+ </table>
356
+ </th>
357
+ </tr>
358
+ </tbody>
359
+ </table>
360
+ </th>
361
+
362
+ </tr>
363
+ </tbody>
364
+ </table>
365
+ </div>".html_safe
366
+ end
367
+
368
+ def gutter(...)
369
+ # only horizontal
370
+ "<div>
371
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
372
+ <tbody>
373
+ <tr>
374
+ #{Gutter.new(parent).horizontal(...)}
375
+ </tr>
376
+ </tbody>
377
+ </table>
378
+ </div>".html_safe
379
+ end
380
+
381
+ def horizontal_grid(**options, &block)
382
+ "<div>
383
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
384
+ <tbody>
385
+ <tr>
386
+ #{HorizontalGrid.horizontal_grid(parent, **options, &block)}
387
+ </tr>
388
+ </tbody>
389
+ </table>
390
+ </div>".html_safe
391
+ end
392
+
393
+ def vertical_grid(**options, &block)
394
+ "<div>
395
+ <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
396
+ <tbody>
397
+ <tr>
398
+ #{VerticalGrid.vertical_grid(parent, **options, &block)}
399
+ </tr>
400
+ </tbody>
401
+ </table>
402
+ </div>".html_safe
403
+ end
404
+
405
+ # def content(**options, &block)
406
+ # "<div>
407
+ # <table cellpadding='0' cellspacing='0' border='0' width='100%' style='min-width:100%' role='presentation'>
408
+ # <tbody>
409
+ # <tr>
410
+ # #{capture(&block)}
411
+ # </tr>
412
+ # </tbody>
413
+ # </table>
414
+ # </div>".html_safe
415
+ # end
416
+
417
+ end
418
+
419
+ def content_table(**options, &block)
420
+ ContentTable.content_table(self, **options, &block)
421
+ end
422
+ end
423
+ end
@@ -0,0 +1,2 @@
1
+ require "fx_awesome_mails/version"
2
+ require "fx_awesome_mails/railtie" if defined?(Rails)
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :fx_awesome_mails do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fx_awesome_mails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - Felix Gebhard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-10-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 6.1.4
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 6.1.4.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 6.1.4
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 6.1.4.1
33
+ description: Provides various view helpers for cross client mail creation
34
+ email:
35
+ - fukurokujoe@googlemail.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - README.md
41
+ - Rakefile
42
+ - lib/fx_awesome_mails.rb
43
+ - lib/fx_awesome_mails/railtie.rb
44
+ - lib/fx_awesome_mails/version.rb
45
+ - lib/fx_awesome_mails/view_helpers.rb
46
+ - lib/tasks/fx_awesome_mails_tasks.rake
47
+ homepage: https://github.com/nemesit/fx_awesome_mails
48
+ licenses:
49
+ - ''
50
+ metadata:
51
+ homepage_uri: https://github.com/nemesit/fx_awesome_mails
52
+ source_code_uri: https://github.com/nemesit/fx_awesome_mails
53
+ changelog_uri: https://github.com/nemesit/fx_awesome_mails/blob/master/CHANGELOG.md
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubygems_version: 3.1.6
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Provides various view helpers for cross client mail creation
73
+ test_files: []