Skip to content

Commit 342e693

Browse files
authored
feat: render optional custom mensagem (#36)
* fix(invoice_issued): prevents error with orders without invoice number * feat: render optional custom mensagem fixes #28
1 parent bc97b9b commit 342e693

26 files changed

+204
-96
lines changed

src/index.js

+48-48
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ transactionalMails.welcome(store, customer, 'pt_br')
3939
4040
*/
4141

42-
welcome (store, customer, lang) {
43-
const data = { store, customer }
42+
welcome (store, customer, lang, custom_message) {
43+
const data = { store, customer, custom_message }
4444
return render('welcome', data, store, lang)
4545
},
4646

@@ -62,8 +62,8 @@ transactionalMails.abandonedCart(store, customer, cart, 'pt_br')
6262
6363
*/
6464

65-
abandonedCart (store, customer, cart, lang) {
66-
const data = { store, customer, cart }
65+
abandonedCart (store, customer, cart, lang, custom_message) {
66+
const data = { store, customer, cart, custom_message }
6767
return render('abandoned-cart', data, store, lang)
6868
},
6969

@@ -85,8 +85,8 @@ transactionalMails.pending(store, customer, order, 'pt_br')
8585
8686
*/
8787

88-
pending (store, customer, order, lang) {
89-
const data = { store, customer, order }
88+
pending (store, customer, order, lang, custom_message) {
89+
const data = { store, customer, order, custom_message }
9090
return render('pending', data, store, lang)
9191
},
9292

@@ -108,8 +108,8 @@ transactionalMails.delivered(store, customer, order, 'pt_br')
108108
109109
*/
110110

111-
delivered (store, customer, order, lang) {
112-
const data = { store, customer, order }
111+
delivered (store, customer, order, lang, custom_message) {
112+
const data = { store, customer, order, custom_message }
113113
return render('delivered', data, store, lang)
114114
},
115115

@@ -131,8 +131,8 @@ transactionalMails.shipped(store, customer, order, 'pt_br')
131131
132132
*/
133133

134-
shipped (store, customer, order, lang) {
135-
const data = { store, customer, order }
134+
shipped (store, customer, order, lang, custom_message) {
135+
const data = { store, customer, order, custom_message }
136136
return render('shipped', data, store, lang)
137137
},
138138

@@ -154,8 +154,8 @@ transactionalMails.unauthorized(store, customer, order, 'pt_br')
154154
155155
*/
156156

157-
unauthorized (store, customer, order, lang) {
158-
const data = { store, customer, order }
157+
unauthorized (store, customer, order, lang, custom_message) {
158+
const data = { store, customer, order, custom_message }
159159
return render('unauthorized', data, store, lang)
160160
},
161161

@@ -177,8 +177,8 @@ transactionalMails.voided(store, customer, order, 'pt_br')
177177
178178
*/
179179

180-
voided (store, customer, order, lang) {
181-
const data = { store, customer, order }
180+
voided (store, customer, order, lang, custom_message) {
181+
const data = { store, customer, order, custom_message }
182182
return render('voided', data, store, lang)
183183
},
184184

@@ -200,8 +200,8 @@ transactionalMails.underAnalysis(store, customer, order, 'pt_br')
200200
201201
*/
202202

203-
underAnalysis (store, customer, order, lang) {
204-
const data = { store, customer, order }
203+
underAnalysis (store, customer, order, lang, custom_message) {
204+
const data = { store, customer, order, custom_message }
205205
return render('under_analysis', data, store, lang)
206206
},
207207

@@ -223,8 +223,8 @@ transactionalMails.partiallyPaid(store, customer, order, 'pt_br')
223223
224224
*/
225225

226-
partiallyPaid (store, customer, order, lang) {
227-
const data = { store, customer, order }
226+
partiallyPaid (store, customer, order, lang, custom_message) {
227+
const data = { store, customer, order, custom_message }
228228
return render('partially_paid', data, store, lang)
229229
},
230230

@@ -246,8 +246,8 @@ transactionalMails.paid(store, customer, order, 'pt_br')
246246
247247
*/
248248

249-
paid (store, customer, order, lang) {
250-
const data = { store, customer, order }
249+
paid (store, customer, order, lang, custom_message) {
250+
const data = { store, customer, order, custom_message }
251251
return render('paid', data, store, lang)
252252
},
253253

@@ -269,8 +269,8 @@ transactionalMails.inDispute(store, customer, order, 'pt_br')
269269
270270
*/
271271

272-
inDispute (store, customer, order, lang) {
273-
const data = { store, customer, order }
272+
inDispute (store, customer, order, lang, custom_message) {
273+
const data = { store, customer, order, custom_message }
274274
return render('in_dispute', data, store, lang)
275275
},
276276

@@ -292,8 +292,8 @@ transactionalMails.partiallyRefunded(store, customer, order, 'pt_br')
292292
293293
*/
294294

295-
partiallyRefunded (store, customer, order, lang) {
296-
const data = { store, customer, order }
295+
partiallyRefunded (store, customer, order, lang, custom_message) {
296+
const data = { store, customer, order, custom_message }
297297
return render('partially_refunded', data, store, lang)
298298
},
299299

@@ -315,8 +315,8 @@ transactionalMails.refunded(store, customer, order, 'pt_br')
315315
316316
*/
317317

318-
refunded (store, customer, order, lang) {
319-
const data = { store, customer, order }
318+
refunded (store, customer, order, lang, custom_message) {
319+
const data = { store, customer, order, custom_message }
320320
return render('refunded', data, store, lang)
321321
},
322322

@@ -338,8 +338,8 @@ transactionalMails.invoiceIssued(store, customer, order, 'pt_br')
338338
339339
*/
340340

341-
invoiceIssued (store, customer, order, lang) {
342-
const data = { store, customer, order }
341+
invoiceIssued (store, customer, order, lang, custom_message) {
342+
const data = { store, customer, order, custom_message}
343343
return render('invoice_issued', data, store, lang)
344344
},
345345

@@ -361,8 +361,8 @@ transactionalMails.inProduction(store, customer, order, 'pt_br')
361361
362362
*/
363363

364-
inProduction (store, customer, order, lang) {
365-
const data = { store, customer, order }
364+
inProduction (store, customer, order, lang, custom_message) {
365+
const data = { store, customer, order, custom_message }
366366
return render('in_production', data, store, lang)
367367
},
368368

@@ -384,8 +384,8 @@ transactionalMails.inSeparation(store, customer, order, 'pt_br')
384384
385385
*/
386386

387-
inSeparation (store, customer, order, lang) {
388-
const data = { store, customer, order }
387+
inSeparation (store, customer, order, lang, custom_message) {
388+
const data = { store, customer, order, custom_message }
389389
return render('in_separation', data, store, lang)
390390
},
391391

@@ -407,8 +407,8 @@ transactionalMails.readyForShipping(store, customer, order, 'pt_br')
407407
408408
*/
409409

410-
readyForShipping (store, customer, order, lang) {
411-
const data = { store, customer, order }
410+
readyForShipping (store, customer, order, lang, custom_message) {
411+
const data = { store, customer, order, custom_message }
412412
return render('ready_for_shipping', data, store, lang)
413413
},
414414

@@ -430,8 +430,8 @@ transactionalMails.partiallyShipped(store, customer, order, 'pt_br')
430430
431431
*/
432432

433-
partiallyShipped (store, customer, order, lang) {
434-
const data = { store, customer, order }
433+
partiallyShipped (store, customer, order, lang, custom_message) {
434+
const data = { store, customer, order, custom_message }
435435
return render('partially_shipped', data, store, lang)
436436
},
437437

@@ -453,8 +453,8 @@ transactionalMails.partiallyDelivered(store, customer, order, 'pt_br')
453453
454454
*/
455455

456-
partiallyDelivered (store, customer, order, lang) {
457-
const data = { store, customer, order }
456+
partiallyDelivered (store, customer, order, lang, custom_message) {
457+
const data = { store, customer, order, custom_message }
458458
return render('partially_delivered', data, store, lang)
459459
},
460460

@@ -476,8 +476,8 @@ transactionalMails.returnedForExchange(store, customer, order, 'pt_br')
476476
477477
*/
478478

479-
returnedForExchange (store, customer, order, lang) {
480-
const data = { store, customer, order }
479+
returnedForExchange (store, customer, order, lang, custom_message) {
480+
const data = { store, customer, order, custom_message }
481481
return render('returned_for_exchange', data, store, lang)
482482
},
483483

@@ -499,8 +499,8 @@ transactionalMails.receivedForExchange(store, customer, order, 'pt_br')
499499
500500
*/
501501

502-
receivedForExchange (store, customer, order, lang) {
503-
const data = { store, customer, order }
502+
receivedForExchange (store, customer, order, lang, custom_message) {
503+
const data = { store, customer, order, custom_message }
504504
return render('received_for_exchange', data, store, lang)
505505
},
506506

@@ -522,8 +522,8 @@ transactionalMails.returned(store, customer, order, 'pt_br')
522522
523523
*/
524524

525-
returned (store, customer, order, lang) {
526-
const data = { store, customer, order }
525+
returned (store, customer, order, lang, custom_message) {
526+
const data = { store, customer, order, custom_message }
527527
return render('returned', data, store, lang)
528528
},
529529

@@ -545,8 +545,8 @@ transactionalMails.returned(store, customer, order, 'pt_br')
545545
546546
*/
547547

548-
authorized (store, customer, order, lang) {
549-
const data = { store, customer, order }
548+
authorized (store, customer, order, lang, custom_message) {
549+
const data = { store, customer, order, custom_message }
550550
return render('authorized', data, store, lang)
551551
},
552552

@@ -568,8 +568,8 @@ transactionalMails.returned(store, customer, order, 'pt_br')
568568
569569
*/
570570

571-
new_order (store, customer, order, lang) {
572-
const data = { store, customer, order }
571+
new_order (store, customer, order, lang, custom_message) {
572+
const data = { store, customer, order, custom_message }
573573
return render('new_order', data, store, lang)
574574
}
575575
}

0 commit comments

Comments
 (0)