refs #5094 fix get email
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-05-23 07:39:43 +02:00
parent 26c2ab867d
commit 0045edb698
1 changed files with 4 additions and 1 deletions

View File

@ -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);