corretto
This commit is contained in:
168
emails/ecommerce/order_confirmed/it/html consegnato.pug
Executable file
168
emails/ecommerce/order_confirmed/it/html consegnato.pug
Executable file
@@ -0,0 +1,168 @@
|
|||||||
|
doctype html
|
||||||
|
html
|
||||||
|
head
|
||||||
|
title Ordine n. #{ordernumber} Consegnato
|
||||||
|
|
||||||
|
//- import css/scss stylesheets
|
||||||
|
//- these file names will be replace by gulp with proper css file paths
|
||||||
|
link(rel="stylesheet", href="../sass/basic.scss")
|
||||||
|
link(rel="stylesheet", href="../sass/one/styles.scss")
|
||||||
|
|
||||||
|
//- embdedded css allowed, but not sass
|
||||||
|
style.
|
||||||
|
.red {
|
||||||
|
background-color: #E84C50;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body(yahoofix, style="background: #ffffff")
|
||||||
|
- var baseimg = baseurl + '/';
|
||||||
|
span(id='body_style', style='display:block')
|
||||||
|
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
||||||
|
tr
|
||||||
|
td(class="whitespace", height="10")
|
||||||
|
p
|
||||||
|
|
||||||
|
if (orders.items && orders.items.length > 0)
|
||||||
|
- var mystorehouse = orders.items[0].order.storehouse
|
||||||
|
else
|
||||||
|
- var mystorehouse = null
|
||||||
|
|
||||||
|
tr
|
||||||
|
td(class="emailContainer", valign="top")
|
||||||
|
|
||||||
|
- var mioheader = mystorehouse.email_html_header
|
||||||
|
if (mioheader)
|
||||||
|
p!= mioheader
|
||||||
|
else
|
||||||
|
p Ciao #{name},
|
||||||
|
|
||||||
|
p L'ordine n. #{ordernumber} è stato Consegnato correttamente !
|
||||||
|
|
||||||
|
if (orders.items[0].order.quantitypreordered > 0)
|
||||||
|
- var miomakeorder = mystorehouse.email_html_GAS_order_consegnato
|
||||||
|
else
|
||||||
|
- var miomakeorder = mystorehouse.email_html_order_consegnato
|
||||||
|
|
||||||
|
if (miomakeorder)
|
||||||
|
p!= miomakeorder
|
||||||
|
|
||||||
|
- var totalPrice = orders.totalPrice
|
||||||
|
- var note = orders.note
|
||||||
|
- var index = 0
|
||||||
|
|
||||||
|
each rec in orders.items
|
||||||
|
- var descr = rec.order.product.productInfo.name
|
||||||
|
- var img = rec.order.product.productInfo.img
|
||||||
|
- var price = rec.order.product.price
|
||||||
|
- var after_price = rec.order.product.after_price
|
||||||
|
if (rec.order.gasordine)
|
||||||
|
- var gasordine = rec.order.gasordine.name
|
||||||
|
else
|
||||||
|
- var gasordine = ''
|
||||||
|
- var qty = rec.order.product.quantity
|
||||||
|
- var qtypreordered = rec.order.quantitypreordered
|
||||||
|
- var TotalPriceProduct = rec.order.TotalPriceProduct
|
||||||
|
- index = index + 1
|
||||||
|
|
||||||
|
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||||
|
tr
|
||||||
|
td(class="column", valign="center" width="40")
|
||||||
|
p.boldhigh #{index}.
|
||||||
|
|
||||||
|
td(class="column sectionArticleImage", valign="top" width="150")
|
||||||
|
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src=baseimg + img, alt="", width="150" height="150")
|
||||||
|
td(class="column", valign="top")
|
||||||
|
|
||||||
|
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||||
|
if (qtypreordered > 0)
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Gas Ordine: #{gasordine}
|
||||||
|
p
|
||||||
|
tr
|
||||||
|
td(class="sectionContentTitle boldhigh", valign="top")
|
||||||
|
p #{descr}
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Prezzo: #{price} € #{after_price}
|
||||||
|
if (qty > 0)
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Quantità: #{qty}
|
||||||
|
if (qtypreordered > 0)
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Quantità Prenotata: #{qtypreordered}
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Totale: #{TotalPriceProduct} €
|
||||||
|
|
||||||
|
if (note)
|
||||||
|
p Note Aggiuntive: #{note}
|
||||||
|
|
||||||
|
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||||
|
tr
|
||||||
|
td(class="whitespace", height="10")
|
||||||
|
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
- var miofooter = mystorehouse.email_html_footer
|
||||||
|
if (miofooter)
|
||||||
|
p!= miofooter
|
||||||
|
else
|
||||||
|
p Grazie Mille
|
||||||
|
|
||||||
|
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||||
|
tr
|
||||||
|
td(class="whitespace", height="10")
|
||||||
|
p
|
||||||
|
tr
|
||||||
|
td.firma
|
||||||
|
p!= dataemail.firma
|
||||||
|
|
||||||
|
tr
|
||||||
|
td.disclaimer
|
||||||
|
p!= dataemail.disclaimer_out
|
||||||
|
|
||||||
|
tr
|
||||||
|
td.bottom
|
||||||
|
p!= dataemail.disc_bottom_out
|
||||||
|
|
||||||
|
tr
|
||||||
|
td(class="whitespace", height="10")
|
||||||
|
p
|
||||||
|
|
||||||
|
style(type="text/css").
|
||||||
|
html, body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.divbtn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-lg {
|
||||||
|
padding: 5px;
|
||||||
|
margin: 5px;
|
||||||
|
font-size: 26px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: white;
|
||||||
|
background: #027be3 !important;
|
||||||
|
border-radius: 28px;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
doctype html
|
doctype html
|
||||||
html
|
html
|
||||||
head
|
head
|
||||||
title Ordine Confermato
|
title Ordine n. #{ordernumber} Confermato
|
||||||
|
|
||||||
//- import css/scss stylesheets
|
//- import css/scss stylesheets
|
||||||
//- these file names will be replace by gulp with proper css file paths
|
//- these file names will be replace by gulp with proper css file paths
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
doctype html
|
doctype html
|
||||||
html
|
html
|
||||||
head
|
head
|
||||||
title Ordine consegnato
|
title Ordine n. #{ordernumber} Consegnato
|
||||||
|
|
||||||
//- import css/scss stylesheets
|
//- import css/scss stylesheets
|
||||||
//- these file names will be replace by gulp with proper css file paths
|
//- these file names will be replace by gulp with proper css file paths
|
||||||
@@ -19,28 +19,30 @@ html
|
|||||||
}
|
}
|
||||||
|
|
||||||
body(yahoofix, style="background: #ffffff")
|
body(yahoofix, style="background: #ffffff")
|
||||||
- var baseimg = baseurl + '/'
|
- var baseimg = baseurl + '/';
|
||||||
span(id='body_style', style='display:block')
|
span(id='body_style', style='display:block')
|
||||||
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
table(cellpadding="10", cellspacing="0", width="600", align="center")
|
||||||
tr
|
tr
|
||||||
td(class="whitespace", height="10")
|
td(class="whitespace", height="10")
|
||||||
p
|
p
|
||||||
|
|
||||||
|
if (orders.items && orders.items.length > 0)
|
||||||
|
- var mystorehouse = orders.items[0].order.storehouse
|
||||||
|
else
|
||||||
|
- var mystorehouse = null
|
||||||
|
|
||||||
tr
|
tr
|
||||||
td(class="emailContainer", valign="top")
|
td(class="emailContainer", valign="top")
|
||||||
|
|
||||||
|
|
||||||
if (orders.items && orders.items.length > 0)
|
|
||||||
- var mystorehouse = orders.items[0].order.storehouse
|
|
||||||
else
|
|
||||||
- var mystorehouse = null
|
|
||||||
|
|
||||||
- var mioheader = mystorehouse.email_html_header
|
- var mioheader = mystorehouse.email_html_header
|
||||||
if (mioheader)
|
if (mioheader)
|
||||||
p!= mioheader
|
p!= mioheader
|
||||||
else
|
else
|
||||||
p Ciao #{username},
|
p Ciao #{name},
|
||||||
|
|
||||||
p L'ordine n. #{ordernumber} è stato Consegnato correttamente !
|
p L'ordine n. #{ordernumber} è stato Consegnato correttamente 📦 !
|
||||||
|
p Grazie per averci scelto 🙏🏻 e alla prossima !
|
||||||
|
p
|
||||||
|
|
||||||
if (orders.items[0].order.quantitypreordered > 0)
|
if (orders.items[0].order.quantitypreordered > 0)
|
||||||
- var miomakeorder = mystorehouse.email_html_GAS_order_consegnato
|
- var miomakeorder = mystorehouse.email_html_GAS_order_consegnato
|
||||||
@@ -50,6 +52,67 @@ html
|
|||||||
if (miomakeorder)
|
if (miomakeorder)
|
||||||
p!= miomakeorder
|
p!= miomakeorder
|
||||||
|
|
||||||
|
- var totalPrice = orders.totalPrice
|
||||||
|
- var note = orders.note
|
||||||
|
- var index = 0
|
||||||
|
|
||||||
|
each rec in orders.items
|
||||||
|
- var descr = rec.order.product.productInfo.name
|
||||||
|
- var img = rec.order.product.productInfo.img
|
||||||
|
- var price = rec.order.product.price
|
||||||
|
- var after_price = rec.order.product.after_price
|
||||||
|
if (rec.order.gasordine)
|
||||||
|
- var gasordine = rec.order.gasordine.name
|
||||||
|
else
|
||||||
|
- var gasordine = ''
|
||||||
|
- var qty = rec.order.product.quantity
|
||||||
|
- var qtypreordered = rec.order.quantitypreordered
|
||||||
|
- var TotalPriceProduct = rec.order.TotalPriceProduct
|
||||||
|
- index = index + 1
|
||||||
|
|
||||||
|
table(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||||
|
tr
|
||||||
|
td(class="column", valign="center" width="40")
|
||||||
|
p.boldhigh #{index}.
|
||||||
|
|
||||||
|
td(class="column sectionArticleImage", valign="top" width="150")
|
||||||
|
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src=baseimg + img, alt="", width="150" height="150")
|
||||||
|
td(class="column", valign="top")
|
||||||
|
|
||||||
|
table(cellpadding="0", cellspacing="0", summary="", border="0")
|
||||||
|
if (qtypreordered > 0)
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Gas Ordine: #{gasordine}
|
||||||
|
p
|
||||||
|
tr
|
||||||
|
td(class="sectionContentTitle boldhigh", valign="top")
|
||||||
|
p #{descr}
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Prezzo: #{price} € #{after_price}
|
||||||
|
if (qty > 0)
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Quantità: #{qty}
|
||||||
|
if (qtypreordered > 0)
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Quantità Prenotata: #{qtypreordered}
|
||||||
|
tr
|
||||||
|
td(class="sectionContent", valign="top")
|
||||||
|
p Totale: #{TotalPriceProduct} €
|
||||||
|
|
||||||
|
if (note)
|
||||||
|
p Note Aggiuntive: #{note}
|
||||||
|
|
||||||
|
p.sectionContentTitle.boldhigh.sectionTotal Totale Ordine: #{totalPrice} €
|
||||||
|
tr
|
||||||
|
td(class="whitespace", height="10")
|
||||||
|
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
- var miofooter = mystorehouse.email_html_footer
|
- var miofooter = mystorehouse.email_html_footer
|
||||||
@@ -57,7 +120,7 @@ html
|
|||||||
p!= miofooter
|
p!= miofooter
|
||||||
else
|
else
|
||||||
p Grazie Mille
|
p Grazie Mille
|
||||||
|
|
||||||
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
table.footer(cellpadding="0", cellspacing="0", width="100%", summary="", border="0", align="center")
|
||||||
tr
|
tr
|
||||||
td(class="whitespace", height="10")
|
td(class="whitespace", height="10")
|
||||||
@@ -88,6 +151,7 @@ style(type="text/css").
|
|||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.divbtn {
|
.divbtn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ router.post('/:userId/ordercartstatus', authenticate, async function (req, res,
|
|||||||
const { User } = require('../models/user');
|
const { User } = require('../models/user');
|
||||||
|
|
||||||
|
|
||||||
let orderscart = await OrdersCart.findOne({ idapp, _id: order_id }).lean();
|
let myOrdersCart = await OrdersCart.findOne({ idapp, _id: order_id }).lean();
|
||||||
|
|
||||||
if ((userId !== String(req.user._id)) && !User.isManager(req.user.perm)) {
|
if ((userId !== String(req.user._id)) && !User.isManager(req.user.perm)) {
|
||||||
// I'm trying to write something not mine!
|
// I'm trying to write something not mine!
|
||||||
@@ -361,19 +361,19 @@ router.post('/:userId/ordercartstatus', authenticate, async function (req, res,
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!!orderscart) {
|
if (!!myOrdersCart) {
|
||||||
|
|
||||||
let fields_to_update = { status };
|
let fields_to_update = { status };
|
||||||
|
|
||||||
await OrdersCart.findOneAndUpdate({ _id: order_id }, { $set: fields_to_update }
|
await OrdersCart.findOneAndUpdate({ _id: order_id }, { $set: fields_to_update }
|
||||||
, { new: false })
|
, { new: false })
|
||||||
.then(async (ris) => {
|
.then(async (ris) => {
|
||||||
const userDest = await User.findById(ordersCart.userId).lean();
|
const userDest = await User.findById(myOrdersCart.userId).lean();
|
||||||
|
|
||||||
if (ris) {
|
if (ris) {
|
||||||
|
|
||||||
// Aggiorna gli Stati Interni !
|
// Aggiorna gli Stati Interni !
|
||||||
ordersCart = await OrdersCart.updateCmd(ordersCart, status, true, options);
|
myOrdersCart = await OrdersCart.updateCmd(myOrdersCart, status, true, options);
|
||||||
|
|
||||||
let ordertype = '';
|
let ordertype = '';
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ router.post('/:userId/ordercartstatus', authenticate, async function (req, res,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ordertype !== '') {
|
if (ordertype !== '') {
|
||||||
sendemail.sendEmail_Order(userDest.lang, idapp, ordersCart, userDest, ordertype, status)
|
sendemail.sendEmail_Order(userDest.lang, idapp, myOrdersCart, userDest, ordertype, status)
|
||||||
.then((ris) => {
|
.then((ris) => {
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -394,6 +394,7 @@ router.post('/:userId/ordercartstatus', authenticate, async function (req, res,
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
let orderscart = null;
|
let orderscart = null;
|
||||||
|
|
||||||
if (User.isManager(user.perm)) {
|
if (User.isManager(user.perm)) {
|
||||||
@@ -407,6 +408,7 @@ router.post('/:userId/ordercartstatus', authenticate, async function (req, res,
|
|||||||
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('err', e);
|
||||||
return res.send({ code: server_constants.RIS_CODE_ERR, status: 0 });
|
return res.send({ code: server_constants.RIS_CODE_ERR, status: 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user