Merge pull request 'fix: refs #6831 filter observation' (!3131) from 6831-observationDefaulterEmail into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3131
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2024-10-21 12:26:04 +00:00
commit f8c83c8f68
2 changed files with 3 additions and 2 deletions

View File

@ -74,7 +74,8 @@ module.exports = Self => {
pm.name payMethod,
r.finished IS NULL hasRecovery,
dp.id departmentFk,
dp.name departmentName
dp.name departmentName,
dp.notificationEmail departmentEmail
FROM defaulter d
JOIN client c ON c.id = d.clientFk
JOIN country cn ON cn.id = c.countryFk

View File

@ -47,7 +47,7 @@ module.exports = Self => {
await models.Mail.create({
subject: $t('Comment added to client', {clientFk: defaulter.clientFk}),
body: body,
receiver: `${defaulter.salesPersonName}@verdnatura.es`,
receiver: `${defaulter.departmentEmail}`,
replyTo: `${user.name}@verdnatura.es`
}, myOptions);
}