made sendEmail async
This commit is contained in:
parent
24f10e4f29
commit
2f20cf2968
1 changed files with 5 additions and 3 deletions
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue