stuff done

This commit is contained in:
2025-03-11 02:54:09 +02:00
parent 58e7ed2f06
commit 516b45fad9
90 changed files with 2950 additions and 9458 deletions

44
actions/admin/mailer.ts Normal file
View File

@@ -0,0 +1,44 @@
'use server'
import nodemailer from 'nodemailer'
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
user: 'vista@ugmail.org',
pass: 'hqhowacppifsefxl'
}
})
type SendMailProps = {
email: string
subject: string
text: string
html: string
}
export async function sendMail({email, subject, text, html}: SendMailProps) {
try {
const info = await transporter.sendMail({
from: `"BeWell" <vista@ugmail.org>`,
to: email,
bcc: [
'yevhen.odynets@gmail.com',
'shopping@amok.space',
{
name: 'Actus Septem',
address: 'actus.septem@ukr.net'
}
],
subject,
text,
html
})
return {ok: true, messageId: info.messageId}
} catch (e) {
return {ok: false, message: JSON.stringify(e)}
}
}