Enhanced file uploading for production (thanks citrinitas3421!)

This commit is contained in:
Ahmed Al-Taiar
2024-08-17 22:27:20 -04:00
parent a82caf96bf
commit 1c46a8e963
15 changed files with 320 additions and 51 deletions

View File

@@ -15,7 +15,7 @@ const transporter = nodemailer.createTransport({
},
})
export async function sendEmail({ to, subject, text, html }: Options) {
export const sendEmail = async ({ to, subject, text, html }: Options) => {
return await transporter.sendMail({
from: `"${process.env.NAME} (noreply)" <${process.env.GMAIL}>`,
to: Array.isArray(to) ? to : [to],
@@ -25,7 +25,7 @@ export async function sendEmail({ to, subject, text, html }: Options) {
})
}
export function censorEmail(email: string): string {
export const censorEmail = (email: string): string => {
const [localPart, domain] = email.split('@')
if (localPart.length <= 2) return `${localPart}@${domain}`