refs #5094 fix get email #1548

Merged
alexm merged 1 commits from 5094-fix_email into test 2023-05-23 05:53:41 +00:00
1 changed files with 4 additions and 1 deletions

View File

@ -58,7 +58,10 @@ module.exports = Self => {
for (const param in args) for (const param in args)
params[param] = args[param]; 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); const email = new Email('delivery-note', params);