spree_emails 4.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -0
  3. data/LICENSE +26 -0
  4. data/Rakefile +15 -0
  5. data/app/assets/config/spree_emails_manifest.js +1 -0
  6. data/app/assets/images/logo/spree_50.png +0 -0
  7. data/app/assets/images/noimage/mini.png +0 -0
  8. data/app/assets/images/noimage/noimage/large.png +0 -0
  9. data/app/assets/images/noimage/noimage/mini.png +0 -0
  10. data/app/assets/images/noimage/noimage/product.png +0 -0
  11. data/app/assets/images/noimage/noimage/small.png +0 -0
  12. data/app/assets/images/noimage/small.png +0 -0
  13. data/app/helpers/spree/mail_helper.rb +34 -0
  14. data/app/mailers/spree/base_mailer.rb +46 -0
  15. data/app/mailers/spree/order_mailer.rb +26 -0
  16. data/app/mailers/spree/reimbursement_mailer.rb +12 -0
  17. data/app/mailers/spree/shipment_mailer.rb +12 -0
  18. data/app/mailers/spree/test_mailer.rb +8 -0
  19. data/app/models/spree/emails/order_decorator.rb +28 -0
  20. data/app/models/spree/emails/reimbursement_decorator.rb +11 -0
  21. data/app/models/spree/emails/shipment_handler_decorator.rb +13 -0
  22. data/app/views/layouts/spree/base_mailer.html.erb +46 -0
  23. data/app/views/spree/order_mailer/cancel_email.html.erb +24 -0
  24. data/app/views/spree/order_mailer/cancel_email.text.erb +12 -0
  25. data/app/views/spree/order_mailer/confirm_email.html.erb +23 -0
  26. data/app/views/spree/order_mailer/confirm_email.text.erb +12 -0
  27. data/app/views/spree/order_mailer/store_owner_notification_email.html.erb +23 -0
  28. data/app/views/spree/order_mailer/store_owner_notification_email.text.erb +12 -0
  29. data/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb +48 -0
  30. data/app/views/spree/reimbursement_mailer/reimbursement_email.text.erb +24 -0
  31. data/app/views/spree/shared/_base_mailer_footer.html.erb +12 -0
  32. data/app/views/spree/shared/_base_mailer_header.html.erb +8 -0
  33. data/app/views/spree/shared/_base_mailer_stylesheets.html.erb +456 -0
  34. data/app/views/spree/shared/_mailer_line_item.html.erb +12 -0
  35. data/app/views/spree/shared/_purchased_items_table.html.erb +64 -0
  36. data/app/views/spree/shared/purchased_items_table/_adjustment.html.erb +13 -0
  37. data/app/views/spree/shared/purchased_items_table/_line_item.html.erb +19 -0
  38. data/app/views/spree/shared/purchased_items_table/_subtotal.html.erb +13 -0
  39. data/app/views/spree/shared/purchased_items_table/_total.html.erb +13 -0
  40. data/app/views/spree/shipment_mailer/shipped_email.html.erb +36 -0
  41. data/app/views/spree/shipment_mailer/shipped_email.text.erb +17 -0
  42. data/app/views/spree/test_mailer/test_email.html.erb +40 -0
  43. data/app/views/spree/test_mailer/test_email.text.erb +4 -0
  44. data/config/initializers/assets.rb +1 -0
  45. data/lib/generators/spree/emails/install/install_generator.rb +27 -0
  46. data/lib/generators/spree/emails/install/templates/mailers/previews/order_preview.rb +13 -0
  47. data/lib/generators/spree/emails/install/templates/mailers/previews/reimbursement_preview.rb +5 -0
  48. data/lib/generators/spree/emails/install/templates/mailers/previews/shipment_preview.rb +5 -0
  49. data/lib/generators/spree/emails/install/templates/mailers/previews/user_preview.rb +11 -0
  50. data/lib/spree/emails.rb +12 -0
  51. data/lib/spree/emails/engine.rb +18 -0
  52. data/lib/spree_emails.rb +1 -0
  53. data/lib/tasks/email.rake +10 -0
  54. data/script/rails +9 -0
  55. data/spree_emails.gemspec +34 -0
  56. metadata +158 -0
@@ -0,0 +1,48 @@
1
+ <h1>
2
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.dear_customer', name: name_for(@order)) %>
3
+ </h1>
4
+ <p>
5
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.instructions') %>
6
+ </p>
7
+ <p>
8
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.refund_summary') %>
9
+ </p>
10
+ <p>
11
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.total_refunded', total: @reimbursement.display_total) %>
12
+ </p>
13
+ <% if @reimbursement.return_items.exchange_requested.present? %>
14
+ <p>
15
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.exchange_summary') %>
16
+ </p>
17
+
18
+ <table class="purchase_content">
19
+ <% @reimbursement.return_items.exchange_requested.each do |return_item| %>
20
+ <tr>
21
+ <td class="purchase_image">
22
+ <%= link_to(image_tag(variant_image_url(return_item.variant)), spree_storefront_resource_url(return_item.variant.product)) %>
23
+ </td>
24
+ <td class="purchase_item">
25
+ <strong>
26
+ <span class="f-fallback">
27
+ <%= link_to raw(return_item.variant.name), spree_storefront_resource_url(return_item.variant.product) %>
28
+ </span>
29
+ </strong>
30
+ <p class="purchase_item--additional">
31
+ <%= "(#{raw(return_item.exchange_variant.options_text)})" if return_item.exchange_variant.options_text.present? -%>
32
+ </p>
33
+ </td>
34
+ </tr>
35
+ <% end %>
36
+ </table>
37
+ <% if @reimbursement.return_items.awaiting_return.present? && Spree::Config[:expedited_exchanges] %>
38
+ <p>
39
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.days_to_send', days: Spree::Config[:expedited_exchanges_days_window]) %>
40
+ </p>
41
+ <% end %>
42
+ <% end %>
43
+
44
+ <p>
45
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.thanks') %>
46
+ <br />
47
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.store_team', store_name: current_store.name) %>
48
+ </p>
@@ -0,0 +1,24 @@
1
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.dear_customer', name: name_for(@reimbursement.order)) %>
2
+
3
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.instructions') %>
4
+
5
+ ============================================================
6
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.refund_summary') %>
7
+ ============================================================
8
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.total_refunded', total: @reimbursement.display_total) %>
9
+
10
+ <% if @reimbursement.return_items.exchange_requested.present? %>
11
+ ============================================================
12
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.exchange_summary') %>
13
+ ============================================================
14
+ <% @reimbursement.return_items.exchange_requested.each do |return_item| %>
15
+ <%= return_item.variant.sku %> <%= raw(return_item.variant.product.name) %> <%= "(#{raw(return_item.variant.options_text)})" if return_item.variant.options_text.present? -%> -> <%= return_item.exchange_variant.sku %> <%= raw(return_item.exchange_variant.product.name) if return_item.exchange_variant.options_text.present? %> <%= "(#{raw(return_item.exchange_variant.options_text)})" -%>
16
+ <% end %>
17
+
18
+
19
+ <% if @reimbursement.return_items.awaiting_return.present? && Spree::Config[:expedited_exchanges] %>
20
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.days_to_send', days: Spree::Config[:expedited_exchanges_days_window]) %>
21
+ <% end %>
22
+ <% end %>
23
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.thanks') %>
24
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.store_team', store_name: current_store.name) %>
@@ -0,0 +1,12 @@
1
+ <!-- You can override this template to design your own footer.
2
+ <table class="email-footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
3
+ <tr>
4
+ <td class="content-cell" align="center">
5
+ <p class="f-fallback sub align-center">
6
+ <a href="#">Terms</a> | <a href="#">Privacy</a> |
7
+ <a href="#">Unsubscribe</a>
8
+ </p>
9
+ </td>
10
+ </tr>
11
+ </table>
12
+ -->
@@ -0,0 +1,8 @@
1
+ <!-- You can override this template to design your own header. -->
2
+ <tr>
3
+ <td class="email-masthead">
4
+ <%= link_to current_store.url, class: 'template-label' do %>
5
+ <%= image_tag logo_path, class: 'logo', alt: current_store.name, title: current_store.name %>
6
+ <% end %>
7
+ </td>
8
+ </tr>
@@ -0,0 +1,456 @@
1
+ <style type="text/css" rel="stylesheet" media="all">
2
+ /* Base ------------------------------ */
3
+
4
+ @import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap");
5
+
6
+ body {
7
+ width: 100% !important;
8
+ height: 100%;
9
+ margin: 0;
10
+ -webkit-text-size-adjust: none;
11
+ }
12
+
13
+ a {
14
+ color: #3869D4;
15
+ }
16
+
17
+ a img {
18
+ border: none;
19
+ }
20
+
21
+ td {
22
+ word-break: break-word;
23
+ }
24
+
25
+ .preheader {
26
+ display: none !important;
27
+ visibility: hidden;
28
+ mso-hide: all;
29
+ font-size: 1px;
30
+ line-height: 1px;
31
+ max-height: 0;
32
+ max-width: 0;
33
+ opacity: 0;
34
+ overflow: hidden;
35
+ }
36
+
37
+ /* Type ------------------------------ */
38
+
39
+ body,
40
+ td,
41
+ th {
42
+ font-family: "Nunito Sans", Helvetica, Arial, sans-serif;
43
+ }
44
+
45
+ h1 {
46
+ margin-top: 0;
47
+ color: #333333;
48
+ font-size: 22px;
49
+ font-weight: bold;
50
+ text-align: left;
51
+ }
52
+
53
+ h2 {
54
+ margin-top: 0;
55
+ color: #333333;
56
+ font-size: 16px;
57
+ font-weight: bold;
58
+ text-align: left;
59
+ }
60
+
61
+ h3 {
62
+ margin-top: 0;
63
+ color: #333333;
64
+ font-size: 14px;
65
+ font-weight: bold;
66
+ text-align: left;
67
+ }
68
+
69
+ td,
70
+ th {
71
+ font-size: 16px;
72
+ }
73
+
74
+ p,
75
+ ul,
76
+ ol,
77
+ blockquote {
78
+ margin: .4em 0 1.1875em;
79
+ font-size: 16px;
80
+ line-height: 1.625;
81
+ }
82
+
83
+ p.sub {
84
+ font-size: 13px;
85
+ }
86
+
87
+ /* Utilities ------------------------------ */
88
+
89
+ .align-right {
90
+ text-align: right;
91
+ }
92
+
93
+ .align-left {
94
+ text-align: left;
95
+ }
96
+
97
+ .align-center {
98
+ text-align: center;
99
+ }
100
+
101
+ /* Buttons ------------------------------ */
102
+
103
+ .button {
104
+ background-color: #3869D4;
105
+ border-top: 10px solid #3869D4;
106
+ border-right: 18px solid #3869D4;
107
+ border-bottom: 10px solid #3869D4;
108
+ border-left: 18px solid #3869D4;
109
+ display: inline-block;
110
+ color: #FFF;
111
+ text-decoration: none;
112
+ border-radius: 3px;
113
+ box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);
114
+ -webkit-text-size-adjust: none;
115
+ box-sizing: border-box;
116
+ }
117
+
118
+ .button--green {
119
+ background-color: #22BC66;
120
+ border-top: 10px solid #22BC66;
121
+ border-right: 18px solid #22BC66;
122
+ border-bottom: 10px solid #22BC66;
123
+ border-left: 18px solid #22BC66;
124
+ }
125
+
126
+ .button--red {
127
+ background-color: #FF6136;
128
+ border-top: 10px solid #FF6136;
129
+ border-right: 18px solid #FF6136;
130
+ border-bottom: 10px solid #FF6136;
131
+ border-left: 18px solid #FF6136;
132
+ }
133
+
134
+ @media only screen and (max-width: 500px) {
135
+ .button {
136
+ width: 100% !important;
137
+ text-align: center !important;
138
+ }
139
+ }
140
+
141
+ /* Attribute list ------------------------------ */
142
+
143
+ .attributes {
144
+ margin: 0 0 21px;
145
+ }
146
+
147
+ .attributes_content {
148
+ background-color: #F4F4F7;
149
+ padding: 16px;
150
+ }
151
+
152
+ .attributes_item {
153
+ padding: 0;
154
+ }
155
+
156
+ /* Related Items ------------------------------ */
157
+
158
+ .related {
159
+ width: 100%;
160
+ margin: 0;
161
+ padding: 25px 0 0 0;
162
+ -premailer-width: 100%;
163
+ -premailer-cellpadding: 0;
164
+ -premailer-cellspacing: 0;
165
+ }
166
+
167
+ .related_item {
168
+ padding: 10px 0;
169
+ color: #CBCCCF;
170
+ font-size: 15px;
171
+ line-height: 18px;
172
+ }
173
+
174
+ .related_item-title {
175
+ display: block;
176
+ margin: .5em 0 0;
177
+ }
178
+
179
+ .related_item-thumb {
180
+ display: block;
181
+ padding-bottom: 10px;
182
+ }
183
+
184
+ .related_heading {
185
+ border-top: 1px solid #CBCCCF;
186
+ text-align: center;
187
+ padding: 25px 0 10px;
188
+ }
189
+
190
+ /* Discount Code ------------------------------ */
191
+
192
+ .discount {
193
+ width: 100%;
194
+ margin: 0;
195
+ padding: 24px;
196
+ -premailer-width: 100%;
197
+ -premailer-cellpadding: 0;
198
+ -premailer-cellspacing: 0;
199
+ background-color: #F4F4F7;
200
+ border: 2px dashed #CBCCCF;
201
+ }
202
+
203
+ .discount_heading {
204
+ text-align: center;
205
+ }
206
+
207
+ .discount_body {
208
+ text-align: center;
209
+ font-size: 15px;
210
+ }
211
+
212
+ /* Social Icons ------------------------------ */
213
+
214
+ .social {
215
+ width: auto;
216
+ }
217
+
218
+ .social td {
219
+ padding: 0;
220
+ width: auto;
221
+ }
222
+
223
+ .social_icon {
224
+ height: 20px;
225
+ margin: 0 8px 10px 8px;
226
+ padding: 0;
227
+ }
228
+
229
+ /* Data table ------------------------------ */
230
+
231
+ .purchase {
232
+ width: 100%;
233
+ margin: 0;
234
+ -premailer-width: 100%;
235
+ -premailer-cellpadding: 0;
236
+ -premailer-cellspacing: 0;
237
+ }
238
+
239
+ .purchase_content {
240
+ width: 100%;
241
+ margin: 0;
242
+ -premailer-width: 100%;
243
+ -premailer-cellpadding: 0;
244
+ -premailer-cellspacing: 0;
245
+ }
246
+
247
+ .purchase_item {
248
+ padding: 10px 4px;
249
+ color: #51545E;
250
+ font-size: 15px;
251
+ line-height: 18px;
252
+ }
253
+
254
+ .purchase_image {
255
+ padding: 5px;
256
+ }
257
+
258
+ .purchase_item p {
259
+ margin: 0;
260
+ padding: 0.1em 0;
261
+ }
262
+
263
+ .purchase_item--additional {
264
+ font-size: 12px;
265
+ }
266
+
267
+ .purchase_heading {
268
+ padding-bottom: 8px;
269
+ border-bottom: 1px solid #EAEAEC;
270
+ }
271
+
272
+ .purchase_heading p {
273
+ margin: 0;
274
+ color: #85878E;
275
+ font-size: 12px;
276
+ }
277
+
278
+ .purchase_footer {
279
+ padding-top: 15px;
280
+ border-top: 1px solid #EAEAEC;
281
+ }
282
+
283
+ .purchase_total {
284
+ margin: 0;
285
+ text-align: right;
286
+ font-weight: bold;
287
+ color: #333333;
288
+ }
289
+
290
+ .purchase_total--name {
291
+ margin: 0;
292
+ text-align: right;
293
+ color: #333333;
294
+ }
295
+
296
+ .purchase_total--label {
297
+ padding: 0 15px 0 0;
298
+ }
299
+
300
+ .purchase_total-col {
301
+ vertical-align: bottom;
302
+ }
303
+
304
+ body {
305
+ background-color: #F2F4F6;
306
+ color: #51545E;
307
+ }
308
+
309
+ p {
310
+ color: #51545E;
311
+ }
312
+
313
+ .email-wrapper {
314
+ width: 100%;
315
+ margin: 0;
316
+ padding: 0;
317
+ -premailer-width: 100%;
318
+ -premailer-cellpadding: 0;
319
+ -premailer-cellspacing: 0;
320
+ background-color: #F2F4F6;
321
+ }
322
+
323
+ .email-content {
324
+ width: 100%;
325
+ margin: 0;
326
+ padding: 0;
327
+ -premailer-width: 100%;
328
+ -premailer-cellpadding: 0;
329
+ -premailer-cellspacing: 0;
330
+ }
331
+
332
+ /* Masthead ----------------------- */
333
+
334
+ .email-masthead {
335
+ padding: 25px 0;
336
+ text-align: center;
337
+ }
338
+
339
+ .email-masthead_logo {
340
+ width: 94px;
341
+ }
342
+
343
+ .email-masthead_name {
344
+ font-size: 16px;
345
+ font-weight: bold;
346
+ color: #A8AAAF;
347
+ text-decoration: none;
348
+ text-shadow: 0 1px 0 white;
349
+ }
350
+
351
+ /* Body ------------------------------ */
352
+
353
+ .email-body {
354
+ width: 100%;
355
+ margin: 0;
356
+ padding: 0;
357
+ -premailer-width: 100%;
358
+ -premailer-cellpadding: 0;
359
+ -premailer-cellspacing: 0;
360
+ }
361
+
362
+ .email-body_inner {
363
+ width: 570px;
364
+ margin: 0 auto;
365
+ padding: 0;
366
+ -premailer-width: 570px;
367
+ -premailer-cellpadding: 0;
368
+ -premailer-cellspacing: 0;
369
+ background-color: #FFFFFF;
370
+ }
371
+
372
+ .email-footer {
373
+ width: 570px;
374
+ margin: 0 auto;
375
+ padding: 0;
376
+ -premailer-width: 570px;
377
+ -premailer-cellpadding: 0;
378
+ -premailer-cellspacing: 0;
379
+ text-align: center;
380
+ }
381
+
382
+ .email-footer p {
383
+ color: #A8AAAF;
384
+ }
385
+
386
+ .body-action {
387
+ width: 100%;
388
+ margin: 30px auto;
389
+ padding: 0;
390
+ -premailer-width: 100%;
391
+ -premailer-cellpadding: 0;
392
+ -premailer-cellspacing: 0;
393
+ text-align: center;
394
+ }
395
+
396
+ .body-sub {
397
+ margin-top: 25px;
398
+ padding-top: 25px;
399
+ border-top: 1px solid #EAEAEC;
400
+ }
401
+
402
+ .content-cell {
403
+ padding: 40px;
404
+ }
405
+
406
+ /*Media Queries ------------------------------ */
407
+
408
+ @media only screen and (max-width: 600px) {
409
+ .email-body_inner,
410
+ .email-footer {
411
+ width: 100% !important;
412
+ }
413
+ .content-cell {
414
+ padding: 40px 15px !important;
415
+ }
416
+ }
417
+
418
+ @media (prefers-color-scheme: dark) {
419
+ body,
420
+ .email-body,
421
+ .email-body_inner,
422
+ .email-content,
423
+ .email-wrapper,
424
+ .email-masthead,
425
+ .email-footer {
426
+ background-color: #333333 !important;
427
+ color: #FFF !important;
428
+ }
429
+
430
+ p,
431
+ ul,
432
+ ol,
433
+ blockquote,
434
+ h1,
435
+ h2,
436
+ h3 {
437
+ color: #FFF !important;
438
+ }
439
+
440
+ .attributes_content,
441
+ .discount {
442
+ background-color: #222 !important;
443
+ }
444
+
445
+ .email-masthead_name {
446
+ text-shadow: none !important;
447
+ }
448
+ }
449
+ </style>
450
+ <!--[if mso]>
451
+ <style type="text/css">
452
+ .f-fallback {
453
+ font-family: Arial, sans-serif;
454
+ }
455
+ </style>
456
+ <![endif]-->