refs #6067 fix(Mailer): await send email
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-01-08 14:35:01 +01:00
parent f73a447391
commit 4e823593b5
1 changed files with 12 additions and 10 deletions

View File

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