Merge pull request 'refs #5094 fix get email' (!1548) from 5094-fix_email into test
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1548
Reviewed-by: Vicent Llopis <vicent@verdnatura.es>
This commit is contained in:
Alex Moreno 2023-05-23 05:53:29 +00:00
commit 6f0c3eeb29
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);