fix: Allow for offline development
This commit is contained in:
@ -197,19 +197,24 @@ export class Mailer {
|
|||||||
|
|
||||||
if (useTestEmailService) {
|
if (useTestEmailService) {
|
||||||
log("SMTP_USERNAME not provided, generating test account…");
|
log("SMTP_USERNAME not provided, generating test account…");
|
||||||
let testAccount = await nodemailer.createTestAccount();
|
|
||||||
|
|
||||||
const smtpConfig = {
|
try {
|
||||||
host: "smtp.ethereal.email",
|
let testAccount = await nodemailer.createTestAccount();
|
||||||
port: 587,
|
|
||||||
secure: false,
|
|
||||||
auth: {
|
|
||||||
user: testAccount.user,
|
|
||||||
pass: testAccount.pass,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
this.transporter = nodemailer.createTransport(smtpConfig);
|
const smtpConfig = {
|
||||||
|
host: "smtp.ethereal.email",
|
||||||
|
port: 587,
|
||||||
|
secure: false,
|
||||||
|
auth: {
|
||||||
|
user: testAccount.user,
|
||||||
|
pass: testAccount.pass,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
this.transporter = nodemailer.createTransport(smtpConfig);
|
||||||
|
} catch (err) {
|
||||||
|
log(`Could not generate test account: ${err.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user