Skip to content

Commit

Permalink
fix: add callback handlers for sendEmail
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan-bloomscorp committed Apr 14, 2024
1 parent 11525db commit 67a0352
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/email/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export function sendEmail(
engineId: string,
templateId: string,
templateOwnerId: string,
emailMetaData: FormData
emailMetaData: FormData,
onSuccess: () => void,
onError: () => void
): void {

let payload: FormData = new FormData();
Expand Down Expand Up @@ -42,9 +44,11 @@ export function sendEmail(
},
(response: ITransmissionResponse): void => {
if (isDevelopmentMode()) console.log(`email sent successfully`);
onSuccess();
},
(error: string): void => {
if (isDevelopmentMode()) console.log(`email sending error: ${error}`);
onError();
},
(): void => {
}
Expand Down

0 comments on commit 67a0352

Please sign in to comment.