Working and testing the profile module.

This commit is contained in:
charlesgauthereau
2025-12-23 18:25:31 +01:00
parent d504866aad
commit d19a46bee6
9 changed files with 166 additions and 135 deletions
@@ -1,70 +1,8 @@
// "use server"
// import type {EventPayload, DispatchResult} from '../types';
// import nodemailer from 'nodemailer';
// import TestEmailSettings from "@/components/emails/email-settings-test"
//
// export async function sendSmtp(
// config: {
// host: string;
// port: number;
// secure: boolean;
// user: string;
// password: string;
// from: string;
// to: string | string[];
// },
// payload: EventPayload
// ): Promise<DispatchResult> {
// console.log(config)
// const transporter = nodemailer.createTransport({
// pool: true,
// host: config.host,
// port: config.port,
// // secure: config.secure,
// secure: true,
// auth: {user: config.user, pass: config.password},
// });
//
//
//
// const result = await transporter.verify();
// console.log(result);
//
// const html = `
// <h2>${payload.title}</h2>
// <p><strong>Level:</strong> ${payload.level}</p>
// <p>${payload.message.replace(/\n/g, '<br>')}</p>
// ${payload.data ? `<pre>${JSON.stringify(payload.data, null, 2)}</pre>` : ''}
// `;
//
// const info = await transporter.sendMail({
// from: config.from,
// to: Array.isArray(config.to) ? config.to.join(', ') : config.to,
// // to: config.from,
// subject: `[${payload.level.toUpperCase()}] ${payload.title}`,
// html,
// // subject: "Portabase",
// // html: await render(TestEmailSettings(), {}),
// });
//
// console.log(info);
//
// return {
// success: true,
// provider: 'smtp',
// // message: `Email sent: ${info.messageId}`,
// message: `Email sent: ${config.to}`,
// response: info,
// };
// }
"use server";
import { render } from "@react-email/render";
import nodemailer from "nodemailer";
import type { EventPayload, DispatchResult } from '../types';
import EmailNotification from "@/components/emails/email-notification";
import EmailResetPassword from "@/components/emails/email-reset-password";
export async function sendSmtp(
config: {