feat: refs #7027 mailError managed
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javi Gallego 2024-06-19 14:38:56 +02:00
parent cccc87d211
commit b2ad449809
4 changed files with 14 additions and 7 deletions

View File

@ -232,5 +232,6 @@
"Incoterms and Customs agent are required for a non UEE member": "Incoterms and Customs agent are required for a non UEE member",
"It has been invoiced but the PDF could not be generated": "It has been invoiced but the PDF could not be generated",
"It has been invoiced but the PDF of refund not be generated": "It has been invoiced but the PDF of refund not be generated",
"Cannot add holidays on this day": "Cannot add holidays on this day"
"Cannot add holidays on this day": "Cannot add holidays on this day",
"Cannot send mail": "Cannot send mail"
}

View File

@ -365,5 +365,6 @@
"You can only have one PDA": "Solo puedes tener un PDA",
"It has been invoiced but the PDF could not be generated": "Se ha facturado pero no se ha podido generar el PDF",
"It has been invoiced but the PDF of refund not be generated": "Se ha facturado pero no se ha podido generar el PDF del abono",
"Payment method is required": "El método de pago es obligatorio"
"Payment method is required": "El método de pago es obligatorio",
"Cannot send mail": "Não é possível enviar o email"
}

View File

@ -359,5 +359,6 @@
"Select ticket or client": "Choisissez un ticket ou un client",
"It was not able to create the invoice": "Il n'a pas été possible de créer la facture",
"It has been invoiced but the PDF could not be generated": "La facture a été émise mais le PDF n'a pas pu être généré",
"It has been invoiced but the PDF of refund not be generated": "Il a été facturé mais le PDF de remboursement n'a pas été généré"
"It has been invoiced but the PDF of refund not be generated": "Il a été facturé mais le PDF de remboursement n'a pas été généré",
"Cannot send mail": "Impossible d'envoyer le mail"
}

View File

@ -2,6 +2,7 @@ const path = require('path');
const smtp = require('./smtp');
const Component = require('./component');
const Report = require('./report');
const UserError = require('vn-loopback/util/user-error');
if (!process.env.OPENSSL_CONF)
process.env.OPENSSL_CONF = '/etc/ssl/';
@ -9,7 +10,6 @@ if (!process.env.OPENSSL_CONF)
class Email extends Component {
constructor(name, args) {
super(name);
this.args = args;
}
@ -88,7 +88,11 @@ class Email extends Component {
force: options.force
};
try {
return await smtp.send(mailOptions);
} catch (error) {
throw new UserError('Cannot send mail');
}
}
}