From f5d935b9a048bc083dab3e2ad4686052b4129420 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Thu, 23 Nov 2023 17:33:49 +0100 Subject: [PATCH] fix: add debug --- .../api/commande/controllers/commande.js | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/back-strapi/api/commande/controllers/commande.js b/back-strapi/api/commande/controllers/commande.js index 1e6e3354..f5c29763 100644 --- a/back-strapi/api/commande/controllers/commande.js +++ b/back-strapi/api/commande/controllers/commande.js @@ -355,30 +355,34 @@ module.exports = { " - ORDER NUMBER ", entity.id ); - await strapi.plugins["email"].services.email.sendTemplatedEmail( - { - to: entity.email, - }, - EMAIL_ORDER_CONFIRM, - { - 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"]), - } - ), - } - ); + try { + await strapi.plugins["email"].services.email.sendTemplatedEmail( + { + to: entity.email, + }, + EMAIL_ORDER_CONFIRM, + { + 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"]), + } + ), + } + ); + } catch(e) { + console.error("EMAIL ERR", e); + } } } else { const referent_text = await fs.promises.readFile(