Merge pull request 'refs #6067 fix(Mailer): await send email' (!1917) from 6067-mailer-await-email-send into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1917
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
Alex Moreno 2024-01-08 14:03:58 +00:00
commit 3b38482221
1 changed files with 12 additions and 10 deletions

View File

@ -257,18 +257,20 @@ module.exports = function(Self) {
class Mailer {
async send(verifyOptions, cb) {
const url = new URL(verifyOptions.verifyHref);
if (process.env.NODE_ENV) url.port = '';
try {
const url = new URL(verifyOptions.verifyHref);
if (process.env.NODE_ENV) url.port = '';
const params = {
url: url.href,
recipient: verifyOptions.to
};
const email = new Email('email-verify', {
url: url.href,
recipient: verifyOptions.to
});
await email.send();
const email = new Email('email-verify', params);
email.send();
cb(null, verifyOptions.to);
cb(null, verifyOptions.to);
} catch (err) {
cb(err);
}
}
}