From 23849014ec5307748f02164bf67551bbf721eb2b Mon Sep 17 00:00:00 2001 From: James Perkins Date: Wed, 2 Oct 2024 14:29:24 -0400 Subject: [PATCH 1/2] Update to dot com We has dot com, we should use it. --- internal/resend/src/client.tsx | 46 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/internal/resend/src/client.tsx b/internal/resend/src/client.tsx index bf849a3ec6..4047c32675 100644 --- a/internal/resend/src/client.tsx +++ b/internal/resend/src/client.tsx @@ -20,11 +20,13 @@ export class Resend { name: string; workspace: string; }): Promise { - const html = render(); + const html = render( + + ); try { const result = await this.client.emails.send({ to: req.email, - from: "james@updates.unkey.dev", + from: "james@updates.unkey.com", replyTo: this.replyTo, subject: "Your Unkey trial has ended", html, @@ -35,7 +37,10 @@ export class Resend { } throw result.error; } catch (error) { - console.error("Error occurred sending subscription email ", JSON.stringify(error)); + console.error( + "Error occurred sending subscription email ", + JSON.stringify(error) + ); } } @@ -48,7 +53,7 @@ export class Resend { try { const result = await this.client.emails.send({ to: req.email, - from: "james@updates.unkey.dev", + from: "james@updates.unkey.com", replyTo: this.replyTo, subject: "Your Unkey trial has ended", html, @@ -58,18 +63,23 @@ export class Resend { } throw result.error; } catch (error) { - console.error("Error occurred sending subscription email ", JSON.stringify(error)); + console.error( + "Error occurred sending subscription email ", + JSON.stringify(error) + ); } } public async sendWelcomeEmail(req: { email: string }) { - const fiveMinutesFromNow = new Date(Date.now() + 5 * 60 * 1000).toISOString(); + const fiveMinutesFromNow = new Date( + Date.now() + 5 * 60 * 1000 + ).toISOString(); const html = render(); try { const result = await this.client.emails.send({ to: req.email, - from: "james@updates.unkey.dev", + from: "james@updates.unkey.com", replyTo: this.replyTo, subject: "Welcome to Unkey", html, @@ -80,7 +90,10 @@ export class Resend { } throw result.error; } catch (error) { - console.error("Error occurred sending welcome email ", JSON.stringify(error)); + console.error( + "Error occurred sending welcome email ", + JSON.stringify(error) + ); } } @@ -89,11 +102,13 @@ export class Resend { name: string; date: Date; }): Promise { - const html = render(); + const html = render( + + ); try { const result = await this.client.emails.send({ to: req.email, - from: "james@updates.unkey.dev", + from: "james@updates.unkey.com", replyTo: this.replyTo, subject: "There was an issue with your payment", html, @@ -103,7 +118,10 @@ export class Resend { } throw result.error; } catch (error) { - console.error("Error occurred sending payment issue email ", JSON.stringify(error)); + console.error( + "Error occurred sending payment issue email ", + JSON.stringify(error) + ); } } public async sendLeakedKeyEmail(req: { @@ -113,12 +131,14 @@ export class Resend { url: string; }): Promise { const { date, email, source, url } = req; - const html = render(); + const html = render( + + ); try { const result = await this.client.emails.send({ to: email, - from: "james@updates.unkey.dev", + from: "james@updates.unkey.com", replyTo: this.replyTo, subject: "Unkey root key exposed in public Github repository", html: html, From 79af809c1dc667e0364df5afe0bb8b60b5071c47 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:31:18 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- internal/resend/src/client.tsx | 36 ++++++++-------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/internal/resend/src/client.tsx b/internal/resend/src/client.tsx index 4047c32675..f670d41243 100644 --- a/internal/resend/src/client.tsx +++ b/internal/resend/src/client.tsx @@ -20,9 +20,7 @@ export class Resend { name: string; workspace: string; }): Promise { - const html = render( - - ); + const html = render(); try { const result = await this.client.emails.send({ to: req.email, @@ -37,10 +35,7 @@ export class Resend { } throw result.error; } catch (error) { - console.error( - "Error occurred sending subscription email ", - JSON.stringify(error) - ); + console.error("Error occurred sending subscription email ", JSON.stringify(error)); } } @@ -63,17 +58,12 @@ export class Resend { } throw result.error; } catch (error) { - console.error( - "Error occurred sending subscription email ", - JSON.stringify(error) - ); + console.error("Error occurred sending subscription email ", JSON.stringify(error)); } } public async sendWelcomeEmail(req: { email: string }) { - const fiveMinutesFromNow = new Date( - Date.now() + 5 * 60 * 1000 - ).toISOString(); + const fiveMinutesFromNow = new Date(Date.now() + 5 * 60 * 1000).toISOString(); const html = render(); try { @@ -90,10 +80,7 @@ export class Resend { } throw result.error; } catch (error) { - console.error( - "Error occurred sending welcome email ", - JSON.stringify(error) - ); + console.error("Error occurred sending welcome email ", JSON.stringify(error)); } } @@ -102,9 +89,7 @@ export class Resend { name: string; date: Date; }): Promise { - const html = render( - - ); + const html = render(); try { const result = await this.client.emails.send({ to: req.email, @@ -118,10 +103,7 @@ export class Resend { } throw result.error; } catch (error) { - console.error( - "Error occurred sending payment issue email ", - JSON.stringify(error) - ); + console.error("Error occurred sending payment issue email ", JSON.stringify(error)); } } public async sendLeakedKeyEmail(req: { @@ -131,9 +113,7 @@ export class Resend { url: string; }): Promise { const { date, email, source, url } = req; - const html = render( - - ); + const html = render(); try { const result = await this.client.emails.send({