fix: improve send test email UX

This commit is contained in:
Elias Schneider
2023-01-31 13:16:11 +01:00
parent 91a6b3f716
commit 233c26e5cf
3 changed files with 97 additions and 44 deletions

View File

@@ -59,11 +59,16 @@ export class EmailService {
}
async sendTestMail(recipientEmail: string) {
await this.getTransporter().sendMail({
from: `"Pingvin Share" <${this.config.get("SMTP_EMAIL")}>`,
to: recipientEmail,
subject: "Test email",
text: "This is a test email",
});
try {
await this.getTransporter().sendMail({
from: `"Pingvin Share" <${this.config.get("SMTP_EMAIL")}>`,
to: recipientEmail,
subject: "Test email",
text: "This is a test email",
});
} catch (e) {
console.error(e);
throw new InternalServerErrorException(e.message);
}
}
}