Skip to content

Commit 6677844

Browse files
committed
Fixes typescript errors
1 parent d3a7fcc commit 6677844

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

internal-packages/emails/src/transports/aws-ses.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
import { render } from "@react-email/render";
22
import { EmailError, MailMessage, MailTransport, PlainTextMailMessage } from "./index";
3-
import nodemailer from "nodemailer"
4-
import * as awsSes from "@aws-sdk/client-ses"
3+
import nodemailer from "nodemailer";
4+
import * as awsSes from "@aws-sdk/client-ses";
55

66
export type AwsSesMailTransportOptions = {
7-
type: 'aws-ses',
8-
}
7+
type: "aws-ses";
8+
};
99

1010
export class AwsSesMailTransport implements MailTransport {
1111
#client: nodemailer.Transporter;
1212

1313
constructor(options: AwsSesMailTransportOptions) {
14-
const ses = new awsSes.SESClient()
14+
const ses = new awsSes.SESClient();
1515

1616
this.#client = nodemailer.createTransport({
1717
SES: {
1818
aws: awsSes,
19-
ses
20-
}
21-
})
19+
ses,
20+
},
21+
});
2222
}
2323

24-
async send({to, from, replyTo, subject, react}: MailMessage): Promise<void> {
24+
async send({ to, from, replyTo, subject, react }: MailMessage): Promise<void> {
2525
try {
2626
await this.#client.sendMail({
2727
from: from,
2828
to,
2929
replyTo: replyTo,
3030
subject,
31-
html: render(react),
31+
html: await render(react),
3232
});
33-
}
34-
catch (error) {
33+
} catch (error) {
3534
if (error instanceof Error) {
3635
console.error(
3736
`Failed to send email to ${to}, ${subject}. Error ${error.name}: ${error.message}`
@@ -43,7 +42,7 @@ export class AwsSesMailTransport implements MailTransport {
4342
}
4443
}
4544

46-
async sendPlainText({to, from, replyTo, subject, text}: PlainTextMailMessage): Promise<void> {
45+
async sendPlainText({ to, from, replyTo, subject, text }: PlainTextMailMessage): Promise<void> {
4746
try {
4847
await this.#client.sendMail({
4948
from: from,
@@ -52,8 +51,7 @@ export class AwsSesMailTransport implements MailTransport {
5251
subject,
5352
text: text,
5453
});
55-
}
56-
catch (error) {
54+
} catch (error) {
5755
if (error instanceof Error) {
5856
console.error(
5957
`Failed to send email to ${to}, ${subject}. Error ${error.name}: ${error.message}`

internal-packages/emails/src/transports/smtp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SmtpMailTransport implements MailTransport {
2929
to,
3030
replyTo: replyTo,
3131
subject,
32-
html: render(react),
32+
html: await render(react),
3333
});
3434
} catch (error) {
3535
if (error instanceof Error) {

0 commit comments

Comments
 (0)