summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/src/aws.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/core/src/aws.ts')
-rw-r--r--packages/console/core/src/aws.ts53
1 files changed, 28 insertions, 25 deletions
diff --git a/packages/console/core/src/aws.ts b/packages/console/core/src/aws.ts
index e87ada6ef..ce4a20f44 100644
--- a/packages/console/core/src/aws.ts
+++ b/packages/console/core/src/aws.ts
@@ -24,37 +24,40 @@ export namespace AWS {
body: z.string(),
}),
async (input) => {
- const res = await createClient().fetch("https://email.us-east-1.amazonaws.com/v2/email/outbound-emails", {
- method: "POST",
- headers: {
- "X-Amz-Target": "SES.SendEmail",
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- FromEmailAddress: `OpenCode Zen <[email protected]>`,
- Destination: {
- ToAddresses: [input.to],
+ const res = await createClient().fetch(
+ "https://email.us-east-1.amazonaws.com/v2/email/outbound-emails",
+ {
+ method: "POST",
+ headers: {
+ "X-Amz-Target": "SES.SendEmail",
+ "Content-Type": "application/json",
},
- Content: {
- Simple: {
- Subject: {
- Charset: "UTF-8",
- Data: input.subject,
- },
- Body: {
- Text: {
+ body: JSON.stringify({
+ FromEmailAddress: `OpenCode Zen <[email protected]>`,
+ Destination: {
+ ToAddresses: [input.to],
+ },
+ Content: {
+ Simple: {
+ Subject: {
Charset: "UTF-8",
- Data: input.body,
+ Data: input.subject,
},
- Html: {
- Charset: "UTF-8",
- Data: input.body,
+ Body: {
+ Text: {
+ Charset: "UTF-8",
+ Data: input.body,
+ },
+ Html: {
+ Charset: "UTF-8",
+ Data: input.body,
+ },
},
},
},
- },
- }),
- })
+ }),
+ },
+ )
if (!res.ok) {
throw new Error(`Failed to send email: ${res.statusText}`)
}