From 0045edb6982573592dda1c2215beeeaa3ccab6e1 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 23 May 2023 07:39:43 +0200 Subject: [PATCH] refs #5094 fix get email --- back/methods/docuware/deliveryNoteEmail.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/back/methods/docuware/deliveryNoteEmail.js b/back/methods/docuware/deliveryNoteEmail.js index 1497dcdf9..1557a3a87 100644 --- a/back/methods/docuware/deliveryNoteEmail.js +++ b/back/methods/docuware/deliveryNoteEmail.js @@ -58,7 +58,10 @@ module.exports = Self => { for (const param in args) params[param] = args[param]; - if (!recipient) params.recipient = models.Client.findById(recipientId, {fields: ['email']}); + if (!recipient) { + client = await models.Client.findById(recipientId, {fields: ['email']}); + params.recipient = client.email; + } const email = new Email('delivery-note', params); -- 2.40.1