all repos — caroster @ 86db106f053562bc10976f2c0c8d0d5520291370

[Octree] Group carpool to your event https://caroster.io

fix: :ambulance: Fix unsend email because of locales
Tim Izzo tim@octree.ch
Fri, 06 Dec 2024 15:17:30 +0100
commit

86db106f053562bc10976f2c0c8d0d5520291370

parent

1e4cd2561ddba0d298160a89d3e9b78da1e68fe2

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M backend/src/api/email/services/email.tsbackend/src/api/email/services/email.ts

@@ -70,9 +70,13 @@ matchingLocale = locales?.["en"];

if (!matchingLocale) return null; } - const notif = matchingLocale.notifications?.[notifType]; - try { + const notif = + matchingLocale.notifications?.[notifType] || + locales?.["en"]?.notifications?.[notifType]; + + if (!notif) throw new Error(`Can't found notification locale`); + const subject = _.template(notif.title)({ ...variables, host: strapi.config.server.url,