made sendEmail async

This commit is contained in:
Malte Delfs 2021-06-24 19:30:39 +02:00
parent 24f10e4f29
commit 2f20cf2968

View file

@ -58,7 +58,7 @@ export default abstract class EventMail {
* Sends the email to the event attendant and returns a Promise. * Sends the email to the event attendant and returns a Promise.
*/ */
public sendEmail(): Promise<any> { public sendEmail(): Promise<any> {
return new Promise((resolve, reject) => nodemailer.createTransport(this.getMailerOptions().transport).sendMail( new Promise((resolve, reject) => nodemailer.createTransport(this.getMailerOptions().transport).sendMail(
this.getNodeMailerPayload(), this.getNodeMailerPayload(),
(error, info) => { (error, info) => {
if (error) { if (error) {
@ -67,7 +67,9 @@ export default abstract class EventMail {
} else { } else {
resolve(info); resolve(info);
} }
})); })
).catch((e) => console.error("sendEmail", e));
return new Promise((resolve) => resolve("send mail async"));
} }
/** /**