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. | ||||
|    */ | ||||
|   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(), | ||||
|       (error, info) => { | ||||
|         if (error) { | ||||
|  | @ -67,7 +67,9 @@ export default abstract class EventMail { | |||
|         } else { | ||||
|           resolve(info); | ||||
|         } | ||||
|       })); | ||||
|       }) | ||||
|     ).catch((e) => console.error("sendEmail", e)); | ||||
|     return new Promise((resolve) => resolve("send mail async")); | ||||
|   } | ||||
| 
 | ||||
|   /** | ||||
|  | @ -133,4 +135,4 @@ export default abstract class EventMail { | |||
|       Reschedule: <a href="${this.getRescheduleLink()}">${this.getRescheduleLink()}</a> | ||||
|     `;
 | ||||
|   } | ||||
| } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Malte Delfs
						Malte Delfs