fixing issue with mail subject localization

parent 0e6cd7c4
...@@ -499,11 +499,18 @@ module.exports = { ...@@ -499,11 +499,18 @@ module.exports = {
surname: student.surname, surname: student.surname,
license: License.hyphenize(student.license.number) license: License.hyphenize(student.license.number)
}); });
var subject = sails.__({
phrase: 'notification_from_pictogram',
locale: params.lang || 'es-es'
});
console.log("-->" + message); console.log("-->" + message);
mailService.mailer() mailService.mailer()
.send({ .send({
to: supervisor.email, to: supervisor.email,
text: message text: message,
subject: subject
}) })
.then(() => {}) .then(() => {})
.catch((err) => {}); .catch((err) => {});
......
...@@ -284,12 +284,17 @@ module.exports = { ...@@ -284,12 +284,17 @@ module.exports = {
locale: params.lang || 'es-es' locale: params.lang || 'es-es'
}) + 'https://' + req.headers.host + '/sup/activate/' + token; // expires in 1 week }) + 'https://' + req.headers.host + '/sup/activate/' + token; // expires in 1 week
var subject = sails.__({
phrase: 'notification_from_pictogram',
locale: params.lang || 'es-es'
});
sails.log.debug("Sending activation email: \n" + message); sails.log.debug("Sending activation email: \n" + message);
mailService.mailer() mailService.mailer()
.send({ .send({
to: params.email, to: params.email,
subject: subject,
text: message text: message
}) })
.then(() => {cb();}) .then(() => {cb();})
...@@ -343,9 +348,15 @@ module.exports = { ...@@ -343,9 +348,15 @@ module.exports = {
}) + 'https://' + req.headers.host + '/app/#/changepass/' + sailsTokenAuth.issueToken(sup.id, 60); // expires in 1 hour }) + 'https://' + req.headers.host + '/app/#/changepass/' + sailsTokenAuth.issueToken(sup.id, 60); // expires in 1 hour
sails.log.debug("Sending request email: \n" + message); sails.log.debug("Sending request email: \n" + message);
var subject = sails.__({
phrase: 'notification_from_pictogram',
locale: params.lang || 'es-es'
});
mailService.mailer() mailService.mailer()
.send({ .send({
to: params.email, to: params.email,
subject: subject,
text: message text: message
}) })
.then(() => { .then(() => {
...@@ -567,6 +578,10 @@ module.exports = { ...@@ -567,6 +578,10 @@ module.exports = {
mailService.mailer() mailService.mailer()
.send({ .send({
to: sup.email, to: sup.email,
subject: sails.__({
phrase: 'notification_from_pictogram',
locale: params.lang || 'es-es'
}),
text: sails.__({ text: sails.__({
phrase: 'office_link', phrase: 'office_link',
locale: sup.lang || 'es-es' locale: sup.lang || 'es-es'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment