Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: add debug (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon authored Nov 24, 2023
1 parent 1778fc9 commit 50819b6
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions back-strapi/api/commande/controllers/commande.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,32 +422,35 @@ module.exports = {
);

if (!referent.openingHours) referent.openingHours = {};

await strapi.plugins["email"].services.email.sendTemplatedEmail(
{
to: entity.email,
},
EMAIL_ORDER_CONFIRM_REF,
{
order: Object.assign(
_.pick(entity, [
"name",
"first_name",
"last_name",
"id",
"address",
"address_zipcode",
"address_city",
]),
{
delivery_name: delivery_name,
custom_text: custom_text,
box: _.pick(box, ["title"]),
}
),
referent: Object.assign(_.pick(referent, ["openingHours"])),
}
);
try {
await strapi.plugins["email"].services.email.sendTemplatedEmail(
{
to: entity.email,
},
EMAIL_ORDER_CONFIRM_REF,
{
order: Object.assign(
_.pick(entity, [
"name",
"first_name",
"last_name",
"id",
"address",
"address_zipcode",
"address_city",
]),
{
delivery_name: delivery_name,
custom_text: custom_text,
box: _.pick(box, ["title"]),
}
),
referent: Object.assign(_.pick(referent, ["openingHours"])),
}
);
} catch(e) {
console.error("Email referent error", e);
}
}
if (users_email.length > 0) {
strapi.log.info(
Expand Down

0 comments on commit 50819b6

Please sign in to comment.