Skip to content

Commit 2f8eaf9

Browse files
committed
test(views): trying to fix items table
1 parent 2e048e0 commit 2f8eaf9

28 files changed

+1458
-1360
lines changed

scss/styles.scss

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
@import 'variables';
22
@import 'functions';
33

4+
@media only screen and (max-device-width: 480px) {
5+
.desktop-only {
6+
display:none;
7+
}
8+
}
9+
410
body {
511
padding: 20px;
612
margin: 0;

src/index.js

+23
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,29 @@ transactionalMails.voided(store, customer, order, 'pt_br')
576576
return render('authorized', data, store, lang)
577577
},
578578

579+
/**
580+
* @method
581+
* @memberof transactionalMails
582+
* @description Returns HTML markup for new order email.
583+
* @param {object} store - Store body object
584+
* @param {object} customer - Customer body object
585+
* @param {object} order - Order body object
586+
* @param {string} [lang='en_us'] - Snake case language code, eg.: 'en_us', 'pt_br'
587+
* @returns {Promise}
588+
*
589+
* @example
590+
591+
transactionalMails.authorized(store, customer, order, 'pt_br')
592+
.then(html => sendEmail(html, options))
593+
.catch(err => console.error(err))
594+
595+
*/
596+
597+
new_order (store, customer, order, lang) {
598+
const data = { store, customer, order }
599+
return render('new_order', data, store, lang)
600+
},
601+
579602

580603

581604
}

test/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ <h3>Transactional email templates for E-Com Plus stores</h3>
2525
<li><a href="/in_production">in_production</code></a></li>
2626
<li><a href="/in_separation">in_separation</code></a></li>
2727
<li><a href="/invoice_issued">invoice_issued</code></a></li>
28+
<li><a href="/new_order">new_order</code></a></li>
2829
<li><a href="/paid">paid</code></a></li>
2930
<li><a href="/partially_delivered">partially_delivered</code></a></li>
3031
<li><a href="/partially_paid">partially_paid</code></a></li>

test/server.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const {
2424
partiallyDelivered,
2525
returnedForExchange,
2626
receivedForExchange,
27-
returned
27+
returned,
28+
new_order
2829
} = require('./../src/')
2930

3031
// sample JSON data
@@ -39,6 +40,14 @@ const browserSync = require('browser-sync').create()
3940
browserSync.init({
4041
server: './test/',
4142
middleware: [
43+
{
44+
route: '/new_order',
45+
handle (req, res, next) {
46+
new_order(store, customer, order, 'pt_br')
47+
.then(html => res.end(html))
48+
.catch(err => console.error(err))
49+
}
50+
},
4251
{
4352
route: '/welcome',
4453
handle (req, res, next) {
@@ -227,5 +236,5 @@ browserSync.init({
227236

228237
// watch template source files and reload local server
229238
watch: true,
230-
files: [ 'views/*.ejs', 'scss/*.scss', 'i18n/*.json' ]
239+
files: [ 'partials/*.ejs', 'views/*.ejs', 'scss/*.scss', 'i18n/*.json' ]
231240
})

views/abandoned-cart.ejs

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
</head>
1515
1616
<body>
17-
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size: 14px; font-family: arial; color: #000000; background-color: #ebebeb;">
17+
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size: 14px; font-family: arial; color: #000000; background-color: #F7F7F7;">
1818
<div class="webkit">
19-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#ebebeb">
19+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F7F7F7">
2020
<tr>
21-
<td valign="top" bgcolor="#ebebeb" width="100%">
21+
<td valign="top" bgcolor="#F7F7F7" width="100%">
2222
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0" cellspacing="0" border="0">
2323
<tr>
2424
<td width="100%">
@@ -168,15 +168,15 @@
168168
<tr>
169169
<td
170170
style="padding: 0px 0px 5px 0px;"
171-
bgcolor="#ebebeb"></td>
171+
bgcolor="#F7F7F7"></td>
172172
</tr>
173173
</table>
174174
</td>
175175
</tr>
176176
</table>
177177
178178
179-
<div data-role="module-unsubscribe" class="module unsubscribe-css__unsubscribe___2CDlR" role="module" data-type="unsubscribe" style="background-color:#ebebeb;color:#7a7a7a;font-size:11px;line-height:20px;padding:30px 0px 30px 0px;text-align:center"><div class="Unsubscribe--addressLine"><p class="Unsubscribe--senderName" style="font-family:;font-size:11px;line-height:20px"><%= store.corporate_name %></p><p style="font-family:;font-size:11px;line-height:20px"><span class="Unsubscribe--senderAddress"><%= store.address %></span></p></div><p style="font-family:;font-size:11px;line-height:20px"><a class="Unsubscribe--unsubscribeLink" href="<%= store.unsubscribe %>" style="color:#2277ee"><%= i18n.unsub %></a></p></div>
179+
<div data-role="module-unsubscribe" class="module unsubscribe-css__unsubscribe___2CDlR" role="module" data-type="unsubscribe" style="background-color:#F7F7F7;color:#7a7a7a;font-size:11px;line-height:20px;padding:30px 0px 30px 0px;text-align:center"><div class="Unsubscribe--addressLine"><p class="Unsubscribe--senderName" style="font-family:;font-size:11px;line-height:20px"><%= store.corporate_name %></p><p style="font-family:;font-size:11px;line-height:20px"><span class="Unsubscribe--senderAddress"><%= store.address %></span></p></div><p style="font-family:;font-size:11px;line-height:20px"><a class="Unsubscribe--unsubscribeLink" href="<%= store.unsubscribe %>" style="color:#2277ee"><%= i18n.unsub %></a></p></div>
180180
181181
182182
</td>

0 commit comments

Comments
 (0)