fix: use vn email
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
0dfdcda1a6
commit
d70d848717
|
@ -29,6 +29,9 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
const config = await models.NotificationConfig.findOne({}, myOptions);
|
||||
|
||||
if (!config.cleanDays) return;
|
||||
|
||||
const cleanDate = new Date();
|
||||
cleanDate.setDate(cleanDate.getDate() - config.cleanDays);
|
||||
|
||||
|
@ -36,11 +39,11 @@ module.exports = Self => {
|
|||
where: {status: {inq: status}},
|
||||
created: {lt: cleanDate}
|
||||
}, myOptions);
|
||||
|
||||
if (tx) await tx.commit();
|
||||
} catch (e) {
|
||||
if (tx) await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (tx) await tx.commit();
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const {Email} = require('vn-print');
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('send', {
|
||||
|
@ -35,7 +34,7 @@ module.exports = Self => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'email', 'lang']
|
||||
fields: ['name', 'lang']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +55,7 @@ module.exports = Self => {
|
|||
for (const notificationUser of queue.notification().subscription()) {
|
||||
try {
|
||||
const sendParams = {
|
||||
recipient: notificationUser.user().email,
|
||||
recipient: notificationUser.user().name + '@verdnatura.es',
|
||||
lang: notificationUser.user().lang
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue