spree_custom_email 1.0.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.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +673 -0
  3. data/README.md +27 -0
  4. data/app/controllers/spree/admin/custom_emails_controller.rb +22 -0
  5. data/app/helpers/spree/mail_helper_decorator.rb +7 -0
  6. data/app/helpers/spree/shipment_helper_decorator.rb +15 -0
  7. data/app/helpers/spree_custom_email/admin/base_helper_decorator.rb +15 -0
  8. data/app/mailer/spree/order_mailer_decorator.rb +38 -0
  9. data/app/mailer/spree/reimbursement_mailer_decorator.rb +24 -0
  10. data/app/mailer/spree/shipment_mailer_decorator.rb +24 -0
  11. data/app/models/spree/custom_email.rb +48 -0
  12. data/app/models/spree_custom_email/store_decorator.rb +9 -0
  13. data/app/overrides/add_custom_emails.rb +10 -0
  14. data/app/views/spree/admin/custom_emails/_form.html.erb +29 -0
  15. data/app/views/spree/admin/custom_emails/setting.html.erb +15 -0
  16. data/app/views/spree/admin/shared/sidebar/_custom_emails_menu.html.erb +8 -0
  17. data/app/views/spree/order_mailer/cancel_email.html.erb +33 -0
  18. data/app/views/spree/order_mailer/cancel_email.text.erb +23 -0
  19. data/app/views/spree/order_mailer/confirm_email.html.erb +80 -0
  20. data/app/views/spree/order_mailer/confirm_email.text.erb +48 -0
  21. data/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb +58 -0
  22. data/app/views/spree/reimbursement_mailer/reimbursement_email.text.erb +36 -0
  23. data/app/views/spree/shared/_base_mailer_stylesheets.html.erb +497 -0
  24. data/app/views/spree/shared/purchased_items_table/_line_item.html.erb +28 -0
  25. data/app/views/spree/shipment_mailer/shipped_email.html.erb +73 -0
  26. data/app/views/spree/shipment_mailer/shipped_email.text.erb +33 -0
  27. data/config/initializers/admin_navigation.rb +17 -0
  28. data/config/locales/en.yml +16 -0
  29. data/config/locales/ja.yml +16 -0
  30. data/config/routes.rb +9 -0
  31. data/db/migrate/20250306091041_add_table_spree_custom_emails.rb +32 -0
  32. data/lib/generators/spree_custom_email/install/install_generator.rb +20 -0
  33. data/lib/spree_custom_email/engine.rb +20 -0
  34. data/lib/spree_custom_email/version.rb +7 -0
  35. data/lib/spree_custom_email.rb +4 -0
  36. metadata +119 -0
@@ -0,0 +1,497 @@
1
+ <%# @gem-override spree_core-5.3.6/app/views/spree/shared/_base_mailer_stylesheets.html.erb %>
2
+ <%# reason: メール用スタイルをストアテーマのテキスト色 (text_color) 連動・フォントサイズ調整・モバイル対応 (max-width:480px) に変更している %>
3
+ <%# @see https://github.com/be-agile/giga-repeat/commit/3b4b6a2f3f511caacee322dfbc2444865f203038 %>
4
+ <% text_color = current_store.default_theme.preferences[:text_color] %>
5
+ <% text_color ||= '#000000' %>
6
+
7
+ <style type="text/css" rel="stylesheet" media="all">
8
+
9
+ /* Base ------------------------------ */
10
+
11
+ @import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap");
12
+
13
+ body {
14
+ width: 100% !important;
15
+ height: 100%;
16
+ margin: 0;
17
+ -webkit-text-size-adjust: none;
18
+ font-size: 14px;
19
+ line-height: 1.6;
20
+ }
21
+
22
+ a {
23
+ color: #005bbb;
24
+ }
25
+
26
+ a img {
27
+ border: none;
28
+ }
29
+
30
+ td {
31
+ word-break: break-word;
32
+ }
33
+
34
+ .preheader {
35
+ display: none !important;
36
+ visibility: hidden;
37
+ mso-hide: all;
38
+ font-size: 1px;
39
+ line-height: 1px;
40
+ max-height: 0;
41
+ max-width: 0;
42
+ opacity: 0;
43
+ overflow: hidden;
44
+ }
45
+
46
+ /* Type ------------------------------ */
47
+
48
+ body,
49
+ td,
50
+ th {
51
+ font-family: "Nunito Sans", Helvetica, Arial, sans-serif;
52
+ font-size: 14px;
53
+ line-height: 1.6;
54
+ }
55
+
56
+ h1 {
57
+ margin-top: 0;
58
+ color: #333333;
59
+ font-size: 16px;
60
+ font-weight: bold;
61
+ text-align: left;
62
+ }
63
+
64
+ h2 {
65
+ margin-top: 0;
66
+ color: #333333;
67
+ font-size: 16px;
68
+ font-weight: bold;
69
+ text-align: left;
70
+ }
71
+
72
+ h3 {
73
+ margin-top: 0;
74
+ color: #333333;
75
+ font-size: 16px;
76
+ font-weight: bold;
77
+ text-align: left;
78
+ }
79
+
80
+ td,
81
+ th {
82
+ font-size: 14px;
83
+ }
84
+
85
+ p,
86
+ ul,
87
+ ol,
88
+ blockquote {
89
+ margin: .4em 0 1.1875em;
90
+ font-size: 14px;
91
+ line-height: 1.6;
92
+ }
93
+
94
+ p.sub {
95
+ font-size: 13px;
96
+ }
97
+
98
+ /* Utilities ------------------------------ */
99
+
100
+ .align-right {
101
+ text-align: right;
102
+ }
103
+
104
+ .align-left {
105
+ text-align: left;
106
+ }
107
+
108
+ .align-center {
109
+ text-align: center;
110
+ }
111
+
112
+ /* Buttons ------------------------------ */
113
+
114
+ .button {
115
+ background-color: #3869D4;
116
+ border-top: 10px solid #3869D4;
117
+ border-right: 18px solid #3869D4;
118
+ border-bottom: 10px solid #3869D4;
119
+ border-left: 18px solid #3869D4;
120
+ display: inline-block;
121
+ color: #FFF !important;
122
+ text-decoration: none;
123
+ border-radius: 3px;
124
+ box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);
125
+ -webkit-text-size-adjust: none;
126
+ box-sizing: border-box;
127
+ }
128
+
129
+ .button--green {
130
+ background-color: #22BC66;
131
+ border-top: 10px solid #22BC66;
132
+ border-right: 18px solid #22BC66;
133
+ border-bottom: 10px solid #22BC66;
134
+ border-left: 18px solid #22BC66;
135
+ }
136
+
137
+ .button--red {
138
+ background-color: #FF6136;
139
+ border-top: 10px solid #FF6136;
140
+ border-right: 18px solid #FF6136;
141
+ border-bottom: 10px solid #FF6136;
142
+ border-left: 18px solid #FF6136;
143
+ }
144
+
145
+ @media only screen and (max-width: 500px) {
146
+ .button {
147
+ width: 100% !important;
148
+ text-align: center !important;
149
+ }
150
+ }
151
+
152
+ /* Attribute list ------------------------------ */
153
+
154
+ .attributes {
155
+ margin: 0 0 21px;
156
+ }
157
+
158
+ .attributes_content {
159
+ background-color: #F4F4F7;
160
+ padding: 16px;
161
+ }
162
+
163
+ .attributes_item {
164
+ padding: 0;
165
+ }
166
+
167
+ /* Related Items ------------------------------ */
168
+
169
+ .related {
170
+ width: 100%;
171
+ margin: 0;
172
+ padding: 25px 0 0 0;
173
+ -premailer-width: 100%;
174
+ -premailer-cellpadding: 0;
175
+ -premailer-cellspacing: 0;
176
+ }
177
+
178
+ .related_item {
179
+ padding: 10px 0;
180
+ color: #CBCCCF;
181
+ font-size: 15px;
182
+ line-height: 18px;
183
+ }
184
+
185
+ .related_item-title {
186
+ display: block;
187
+ margin: .5em 0 0;
188
+ }
189
+
190
+ .related_item-thumb {
191
+ display: block;
192
+ padding-bottom: 10px;
193
+ }
194
+
195
+ .related_heading {
196
+ border-top: 1px solid #CBCCCF;
197
+ text-align: center;
198
+ padding: 25px 0 10px;
199
+ }
200
+
201
+ /* Discount Code ------------------------------ */
202
+
203
+ .discount {
204
+ width: 100%;
205
+ margin: 0;
206
+ padding: 24px;
207
+ -premailer-width: 100%;
208
+ -premailer-cellpadding: 0;
209
+ -premailer-cellspacing: 0;
210
+ background-color: #F4F4F7;
211
+ border: 2px dashed #CBCCCF;
212
+ }
213
+
214
+ .discount_heading {
215
+ text-align: center;
216
+ }
217
+
218
+ .discount_body {
219
+ text-align: center;
220
+ font-size: 15px;
221
+ }
222
+
223
+ /* Social Icons ------------------------------ */
224
+
225
+ .social {
226
+ width: auto;
227
+ }
228
+
229
+ .social td {
230
+ padding: 0;
231
+ width: auto;
232
+ }
233
+
234
+ .social_icon {
235
+ height: 20px;
236
+ margin: 0 8px 10px 8px;
237
+ padding: 0;
238
+ }
239
+
240
+ /* Data table ------------------------------ */
241
+
242
+ .purchase {
243
+ width: 100%;
244
+ margin: 0;
245
+ -premailer-width: 100%;
246
+ -premailer-cellpadding: 0;
247
+ -premailer-cellspacing: 0;
248
+ }
249
+
250
+ .purchase_content {
251
+ width: 100%;
252
+ margin: 0;
253
+ -premailer-width: 100%;
254
+ -premailer-cellpadding: 0;
255
+ -premailer-cellspacing: 0;
256
+ }
257
+
258
+ .purchase_item {
259
+ padding: 10px 4px;
260
+ color: <%= text_color %>;
261
+ font-size: 14px;
262
+ line-height: 18px;
263
+ }
264
+
265
+ .purchase_image {
266
+ padding: 5px;
267
+ width: 100px;
268
+
269
+ img {
270
+ width: 100px;
271
+ }
272
+ }
273
+
274
+ .purchase_item p {
275
+ margin: 0;
276
+ padding: 0.1em 0;
277
+ }
278
+
279
+ .purchase_item--additional {
280
+ font-size: 12px;
281
+ }
282
+
283
+ .purchase_heading {
284
+ padding-bottom: 8px;
285
+ border-bottom: 1px solid #EAEAEC;
286
+ }
287
+
288
+ .purchase_heading p {
289
+ margin: 0;
290
+ color: #85878E;
291
+ font-size: 12px;
292
+ }
293
+
294
+ .purchase_footer {
295
+ padding-top: 15px;
296
+ border-top: 1px solid #EAEAEC;
297
+ }
298
+
299
+ .purchase_total {
300
+ margin: 0;
301
+ text-align: right;
302
+ font-weight: bold;
303
+ color: #333333;
304
+ font-size: 15px;
305
+ }
306
+
307
+ .purchase_total--name {
308
+ margin: 0;
309
+ text-align: right;
310
+ color: #333333;
311
+ }
312
+
313
+ .purchase_total--label {
314
+ padding: 0 15px 0 0;
315
+ }
316
+
317
+ .purchase_total-col {
318
+ vertical-align: bottom;
319
+ }
320
+
321
+ body {
322
+ background-color: #F2F4F6;
323
+ color: <%= text_color %>;
324
+ }
325
+
326
+ p {
327
+ color: <%= text_color %>;
328
+ }
329
+
330
+ .email-wrapper {
331
+ width: 100%;
332
+ margin: 0;
333
+ padding: 0;
334
+ -premailer-width: 100%;
335
+ -premailer-cellpadding: 0;
336
+ -premailer-cellspacing: 0;
337
+ background-color: #F2F4F6;
338
+ }
339
+
340
+ .email-content {
341
+ width: 100%;
342
+ margin: 0;
343
+ padding: 0;
344
+ -premailer-width: 100%;
345
+ -premailer-cellpadding: 0;
346
+ -premailer-cellspacing: 0;
347
+ }
348
+
349
+ /* Masthead ----------------------- */
350
+
351
+ .email-masthead {
352
+ padding: 25px 0;
353
+ text-align: center;
354
+ }
355
+
356
+ .email-masthead_logo {
357
+ width: 94px;
358
+ }
359
+
360
+ .email-masthead_name {
361
+ font-size: 16px;
362
+ font-weight: bold;
363
+ color: #A8AAAF;
364
+ text-decoration: none;
365
+ text-shadow: 0 1px 0 white;
366
+ }
367
+
368
+ /* Body ------------------------------ */
369
+
370
+ .email-body {
371
+ width: 100%;
372
+ margin: 0;
373
+ padding: 0;
374
+ -premailer-width: 100%;
375
+ -premailer-cellpadding: 0;
376
+ -premailer-cellspacing: 0;
377
+ }
378
+
379
+ .email-body_inner {
380
+ width: 570px;
381
+ margin: 0 auto;
382
+ padding: 0;
383
+ -premailer-width: 570px;
384
+ -premailer-cellpadding: 0;
385
+ -premailer-cellspacing: 0;
386
+ background-color: #FFFFFF;
387
+ }
388
+
389
+ .email-footer {
390
+ width: 570px;
391
+ margin: 0 auto;
392
+ padding: 0;
393
+ -premailer-width: 570px;
394
+ -premailer-cellpadding: 0;
395
+ -premailer-cellspacing: 0;
396
+ text-align: center;
397
+ }
398
+
399
+ .email-footer p {
400
+ color: #A8AAAF;
401
+ }
402
+
403
+ .body-action {
404
+ width: 100%;
405
+ margin: 30px auto;
406
+ padding: 0;
407
+ -premailer-width: 100%;
408
+ -premailer-cellpadding: 0;
409
+ -premailer-cellspacing: 0;
410
+ text-align: center;
411
+ }
412
+
413
+ .body-sub {
414
+ margin-top: 25px;
415
+ padding-top: 25px;
416
+ border-top: 1px solid #EAEAEC;
417
+ }
418
+
419
+ .content-cell {
420
+ padding: 40px;
421
+ }
422
+
423
+ /*Media Queries ------------------------------ */
424
+
425
+ @media only screen and (max-width: 600px) {
426
+ .email-body_inner,
427
+ .email-footer {
428
+ width: 100% !important;
429
+ }
430
+ .content-cell {
431
+ padding: 40px 15px !important;
432
+ }
433
+ }
434
+
435
+ @media only screen and (max-width: 480px) {
436
+ .purchase_image {
437
+ max-width: 80px !important;
438
+ width: 80px !important;
439
+ padding: 5px 2px !important;
440
+ }
441
+ .purchase_image img {
442
+ max-width: 100% !important;
443
+ height: auto !important;
444
+ display: block !important;
445
+ }
446
+ .purchase_item {
447
+ min-width: 120px !important;
448
+ word-break: break-word !important;
449
+ padding: 10px 2px !important;
450
+ }
451
+ .purchase_content td[width="30%"] {
452
+ width: 25% !important;
453
+ }
454
+ .align-right {
455
+ font-size: 14px !important;
456
+ }
457
+ }
458
+
459
+ @media (prefers-color-scheme: dark) {
460
+ body,
461
+ .email-body,
462
+ .email-body_inner,
463
+ .email-content,
464
+ .email-wrapper,
465
+ .email-masthead,
466
+ .email-footer {
467
+ background-color: #333333 !important;
468
+ color: #FFF !important;
469
+ }
470
+
471
+ p,
472
+ ul,
473
+ ol,
474
+ blockquote,
475
+ h1,
476
+ h2,
477
+ h3 {
478
+ color: #FFF !important;
479
+ }
480
+
481
+ .attributes_content,
482
+ .discount {
483
+ background-color: #222 !important;
484
+ }
485
+
486
+ .email-masthead_name {
487
+ text-shadow: none !important;
488
+ }
489
+ }
490
+ </style>
491
+ <!--[if mso]>
492
+ <style type="text/css">
493
+ .f-fallback {
494
+ font-family: Arial, sans-serif;
495
+ }
496
+ </style>
497
+ <![endif]-->
@@ -0,0 +1,28 @@
1
+ <%# @gem-override spree_emails-5.3.6/app/views/spree/shared/purchased_items_table/_line_item.html.erb %>
2
+ <%# reason: メール明細の画像・項目セルにレスポンシブ用スタイル (max-width/word-break) を追加している %>
3
+ <%# @see https://github.com/be-agile/giga-repeat/commit/5b03bd3dbb10b24a633384cc47cd8e2678f5ec84 %>
4
+ <%# Spree 5.3 追従: variant_image_url → default_image + spree_image_tag(variant: :mini)、noimage フォールバックを追加(giga のレスポンシブ style は維持) %>
5
+ <tr>
6
+ <td class="purchase_image">
7
+ <% image = line_item.variant.default_image %>
8
+ <% if image.present? && image.attached? %>
9
+ <%= link_to(spree_image_tag(image, variant: :mini, alt: line_item.name, style: "max-width: 100%; height: auto; display: block;"), spree_storefront_resource_url(line_item.product)) %>
10
+ <% else %>
11
+ <%= link_to(image_tag('noimage/small.png', alt: line_item.name, style: "max-width: 100%; height: auto; display: block;"), spree_storefront_resource_url(line_item.product)) %>
12
+ <% end %>
13
+ </td>
14
+ <td class="purchase_item" style="word-break: break-word;">
15
+ <strong>
16
+ <span class="f-fallback">
17
+ <%= link_to raw(line_item.name), spree_storefront_resource_url(line_item.product) %>
18
+ </span>
19
+ </strong>
20
+ <p class="purchase_item--additional"><%= line_item.variant.options_text -%></p>
21
+ </td>
22
+ <td class="align-right" width="30%">
23
+ <span class="f-fallback purchase_item_price">
24
+ <%= line_item.quantity %> x <%= line_item.single_money %><br>
25
+ <%= line_item.display_amount %>
26
+ </span>
27
+ </td>
28
+ </tr>
@@ -0,0 +1,73 @@
1
+ <%# @gem-override spree_emails-5.3.6/app/views/spree/shipment_mailer/shipped_email.html.erb %>
2
+ <%# reason: カスタムメールのヘッダー/フッター差し込みと、出荷済 inventory_units 単位の明細表示・追跡URL対応を追加している %>
3
+ <%# @see https://github.com/be-agile/giga-repeat/commit/27ad550f76d381992f038b6d1c52270e2d9e78e4 %>
4
+
5
+ <h1>
6
+ <%= Spree.t('shipment_mailer.shipped_email.dear_customer', name: name_for(@shipment.order)) %>
7
+ </h1>
8
+ <% if @spree_custom_email&.header.present? %>
9
+ <p><%= @spree_custom_email.header_for(:html) %></p>
10
+ <% else %>
11
+ <p><%= Spree.t('shipment_mailer.shipped_email.instructions', number: @shipment.order.number) %></p>
12
+ <% end %>
13
+ <table class="purchase" role="presentation">
14
+ <tr>
15
+ <td>
16
+ <h3><%= Spree.t('shipment_mailer.shipped_email.shipment_summary') %></h3>
17
+ </td>
18
+ </tr>
19
+ <tr>
20
+ <td colspan="2">
21
+
22
+ <table class="purchase_content">
23
+ <% @shipment.inventory_units.shipped.each do |inventory| %>
24
+ <% line_item = inventory.line_item %>
25
+ <% next if line_item.blank? %>
26
+
27
+ <tr>
28
+ <td class="purchase_image">
29
+ <%= link_to(image_tag(variant_image_url(line_item.variant), style: "max-width: 100%; height: auto; display: block;"), spree_storefront_resource_url(line_item.product)) %>
30
+ </td>
31
+ <td class="purchase_item" style="word-break: break-word;">
32
+ <strong>
33
+ <span class="f-fallback">
34
+ <%= link_to raw(line_item.name), spree_storefront_resource_url(line_item.product) %>
35
+ </span>
36
+ </strong>
37
+ <p class="purchase_item--additional"><%= line_item.variant.options_text -%></p>
38
+ </td>
39
+ <td class="align-right" width="30%">
40
+ <span class="f-fallback purchase_item_price">
41
+ (× <%= inventory.quantity %>)
42
+ </span>
43
+ </td>
44
+ </tr>
45
+ <% end %>
46
+ </table>
47
+
48
+ </td>
49
+ </tr>
50
+ </table>
51
+ <p>
52
+ <%= Spree.t('shipment_mailer.shipped_email.shipping_method', shipping_method: @shipment.shipping_method.name) %>
53
+ </p>
54
+ <% if @shipment.tracking && !@shipment.tracking&.match?(/\Ahttps?:\/\//) %>
55
+ <p>
56
+ <%= Spree.t('shipment_mailer.shipped_email.track_information', tracking: @shipment.tracking) %>
57
+ </p>
58
+ <% end %>
59
+ <% tracking_url = tracking_url_for_shipment(@shipment) %>
60
+ <% if tracking_url %>
61
+ <p>
62
+ <%= Spree.t('shipment_mailer.shipped_email.track_link', url: link_to(tracking_url, tracking_url)).html_safe %>
63
+ </p>
64
+ <% end %>
65
+ <% if @spree_custom_email&.footer.present? %>
66
+ <p><%= @spree_custom_email.footer_for(:html) %></p>
67
+ <% else %>
68
+ <p>
69
+ <%= Spree.t('shipment_mailer.shipped_email.thanks') %>
70
+ <br />
71
+ <%= Spree.t('shipment_mailer.shipped_email.store_team', store_name: current_store.name) %>
72
+ </p>
73
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <%# @gem-override spree_emails-5.3.6/app/views/spree/shipment_mailer/shipped_email.text.erb %>
2
+ <%# reason: カスタムメールのヘッダー/フッター差し込みと、出荷済 inventory_units 単位の明細・追跡URL対応を追加している (テキスト版) %>
3
+ <%# @see https://github.com/be-agile/giga-repeat/commit/27ad550f76d381992f038b6d1c52270e2d9e78e4 %>
4
+ <%= Spree.t('shipment_mailer.shipped_email.dear_customer', name: name_for(@shipment.order)) %>
5
+
6
+ <% if @spree_custom_email&.header.present? %>
7
+ <%= @spree_custom_email.header_for(:text) %>
8
+ <% else %>
9
+ <%= Spree.t('shipment_mailer.shipped_email.instructions', number: @shipment.order.number) %>
10
+ <% end %>
11
+
12
+ ============================================================
13
+ <%= Spree.t('shipment_mailer.shipped_email.shipment_summary') %>
14
+ ============================================================
15
+ <% @shipment.inventory_units.shipped.each do |inventory| %>
16
+ <% line_item = inventory.line_item %>
17
+ <% variant = inventory.variant %>
18
+ <% next if line_item.blank? || variant.blank? %>
19
+
20
+ <%= variant.sku %> <%= line_item.product.name %> (×<%=inventory.quantity%>) <%= variant.options_text %>
21
+ <% end %>
22
+ ============================================================
23
+
24
+ <%= Spree.t('shipment_mailer.shipped_email.track_information', tracking: @shipment.tracking) if @shipment.tracking && !@shipment.tracking&.match?(/\Ahttps?:\/\//) %>
25
+ <% tracking_url = tracking_url_for_shipment(@shipment) %>
26
+ <%= Spree.t('shipment_mailer.shipped_email.track_link', url: tracking_url) if tracking_url %>
27
+
28
+ <% if @spree_custom_email&.footer.present? %>
29
+ <%= @spree_custom_email.footer_for(:text) %>
30
+ <% else %>
31
+ <%= Spree.t('shipment_mailer.shipped_email.thanks') %>
32
+ <%= Spree.t('shipment_mailer.shipped_email.store_team', store_name: current_store.name) %>
33
+ <% end %>
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Spree 5.2 の新ナビゲーションシステム(legacy_sidebar_navigation=false)に対応。
4
+ # 旧来は _store_nav.html.erb の deface override(legacy)で設定エリアに「カスタムメール」
5
+ # メニューを追加していたが、新システムでは legacy の _store_nav が使われず無視される。
6
+ # Spree.admin.navigation.settings に登録し直す。
7
+ Rails.application.config.after_initialize do
8
+ next unless Spree.admin.navigation.settings.exists?(:stock_locations)
9
+
10
+ Spree.admin.navigation.settings.add :custom_emails,
11
+ label: :custom_emails,
12
+ url: :setting_admin_custom_emails_path,
13
+ icon: 'mail',
14
+ position: 117,
15
+ active: -> { controller_name == 'custom_emails' },
16
+ if: -> { can?(:manage, Spree::CustomEmail) }
17
+ end
@@ -0,0 +1,16 @@
1
+ en:
2
+ spree:
3
+ custom_emails: custom_emails
4
+ subject: subject
5
+ header: header
6
+ footer: footer
7
+ confirm_email: confirm_email
8
+ cancel_email: cancel_email
9
+ reimbursement_email: reimbursement_email
10
+ shipped_email: shipped_email
11
+ Custom email alert info: You can use HTML tags in the header and footer.
12
+ activerecord:
13
+ models:
14
+ spree/custom_email:
15
+ one: custom_email
16
+ other: custom_email
@@ -0,0 +1,16 @@
1
+ ja:
2
+ spree:
3
+ custom_emails: メール
4
+ subject: 件名
5
+ header: ヘッダー
6
+ footer: フッター
7
+ confirm_email: 注文確認メール
8
+ cancel_email: キャンセルメール
9
+ reimbursement_email: 払い戻しメール
10
+ shipped_email: 配送完了メール
11
+ custom_email_alert_info: ヘッダー・フッターにはHTMLタグを使用できます。
12
+ activerecord:
13
+ models:
14
+ spree/custom_email:
15
+ one: メール
16
+ other: メール
data/config/routes.rb ADDED
@@ -0,0 +1,9 @@
1
+ Spree::Core::Engine.routes.draw do
2
+ namespace :admin do
3
+ resources :custom_emails, only: [ :update ] do
4
+ collection do
5
+ get :setting
6
+ end
7
+ end
8
+ end
9
+ end