diff options
| author | Adam Soltys <[email protected]> | 2024-10-31 09:29:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-31 09:34:42 -0700 |
| commit | aa4cd39c943b67169def224e224bd07b815b70ec (patch) | |
| tree | 2af857ac971705f4d20eb017864f0365d0b57ea6 /routes/email.ts | |
| parent | bc9c04f6519f32d3b444d4df0b276eba960480a9 (diff) | |
| download | coinos-server-aa4cd39c943b67169def224e224bd07b815b70ec.tar.gz coinos-server-aa4cd39c943b67169def224e224bd07b815b70ec.zip | |
biome lint
Diffstat (limited to 'routes/email.ts')
| -rw-r--r-- | routes/email.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/routes/email.ts b/routes/email.ts index 63c88ab0..9f0a8228 100644 --- a/routes/email.ts +++ b/routes/email.ts @@ -8,12 +8,12 @@ import { SendEmailCommand } from "@aws-sdk/client-ses"; export default { async send({ body }, res) { try { - let { email, message, username, token: response } = body; + const { email, message, username, token: response } = body; - let Charset = "UTF-8"; + const Charset = "UTF-8"; - let { recaptcha: secret } = config; - let { success } = await got + const { recaptcha: secret } = config; + const { success } = await got .post("https://www.google.com/recaptcha/api/siteverify", { form: { secret, @@ -23,10 +23,10 @@ export default { .json(); if (success || response === config.adminpass) { - delete body.token; + body.token = undefined; warn("support request from", email); - let client = new SESClient({ region: "us-east-2" }); + const client = new SESClient({ region: "us-east-2" }); await client.send( new SendEmailCommand({ Destination: { @@ -42,7 +42,7 @@ export default { Charset, Data: body.subject || - "Support Request" + (username ? " From " + username : ""), + `Support Request${username ? ` From ${username}` : ""}`, }, }, ReplyToAddresses: [email], |
