6870-modifyDefaulterNotification #2383

Merged
carlossa merged 5 commits from 6870-modifyDefaulterNotification into dev 2024-05-02 11:32:02 +00:00
2 changed files with 5 additions and 2 deletions

View File

@ -277,7 +277,7 @@
"Collection does not exist": "La colección no existe", "Collection does not exist": "La colección no existe",
"Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo", "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo",
"Insert a date range": "Inserte un rango de fechas", "Insert a date range": "Inserte un rango de fechas",
"Added observation": "{{user}} añadió esta observacion: {{text}}", "Added observation": "{{user}} añadió esta observacion: {{text}} {{defaulterId}} ({{{defaulterUrl}}})",
"Comment added to client": "Observación añadida al cliente {{clientFk}}", "Comment added to client": "Observación añadida al cliente {{clientFk}}",
"Invalid auth code": "Código de verificación incorrecto", "Invalid auth code": "Código de verificación incorrecto",
"Invalid or expired verification code": "Código de verificación incorrecto o expirado", "Invalid or expired verification code": "Código de verificación incorrecto o expirado",

View File

@ -29,6 +29,7 @@ module.exports = Self => {
const $t = ctx.req.__; // $translate const $t = ctx.req.__; // $translate
const myOptions = {}; const myOptions = {};
const userId = ctx.req.accessToken.userId; const userId = ctx.req.accessToken.userId;
const url = await Self.app.models.Url.getUrl();
if (typeof options == 'object') if (typeof options == 'object')
Object.assign(myOptions, options); Object.assign(myOptions, options);
@ -38,7 +39,9 @@ module.exports = Self => {
const body = $t('Added observation', { const body = $t('Added observation', {
user: user.name, user: user.name,
text: observation text: observation,
defaulterId: defaulter.clientFk,
defaulterUrl: `${url}client/${defaulter.clientFk}/summary`
}); });
await models.Mail.create({ await models.Mail.create({