completionId: cgen-a8c8f2b9c11c48d0abbba6252f23a711
cgen-a8c8f2b9c11c48d0abbba6252f23a711
This commit is contained in:
parent
f44f83007a
commit
5ab09a72b4
1 changed files with 34 additions and 13 deletions
|
|
@ -267,19 +267,40 @@ export default async function handler(req: any, res: any) {
|
||||||
.eq("id", request.user_id)
|
.eq("id", request.user_id)
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
if (userData?.email) {
|
if (userData?.email && emailService.isConfigured) {
|
||||||
await sendEmail({
|
try {
|
||||||
to: userData.email,
|
// Send rejection email using nodemailer
|
||||||
subject: "Ethos Guild Artist Verification - Application Decision",
|
const nodemailer = require("nodemailer");
|
||||||
html: `
|
const transporter = nodemailer.createTransport({
|
||||||
<h2>Ethos Guild Artist Verification</h2>
|
host: process.env.SMTP_HOST,
|
||||||
<p>Thank you for your interest in the Ethos Guild.</p>
|
port: parseInt(process.env.SMTP_PORT || "465"),
|
||||||
<p>Unfortunately, your application was not approved at this time.</p>
|
secure: parseInt(process.env.SMTP_PORT || "465") === 465,
|
||||||
${rejection_reason ? `<p><strong>Feedback:</strong> ${rejection_reason}</p>` : ""}
|
auth: {
|
||||||
<p>You're welcome to reapply with updates to your portfolio or qualifications.</p>
|
user: process.env.SMTP_USER,
|
||||||
<p><a href="https://aethex.dev/ethos">Learn more about the Ethos Guild</a></p>
|
pass: process.env.SMTP_PASSWORD,
|
||||||
`,
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await transporter.sendMail({
|
||||||
|
from: process.env.SMTP_FROM_EMAIL || "no-reply@aethex.tech",
|
||||||
|
to: userData.email,
|
||||||
|
subject: "Ethos Guild Artist Verification - Application Decision",
|
||||||
|
html: `
|
||||||
|
<div style="font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #0f172a;">
|
||||||
|
<h2 style="color: #db2777;">Ethos Guild Artist Verification</h2>
|
||||||
|
<p>Thank you for your interest in the Ethos Guild.</p>
|
||||||
|
<p>Unfortunately, your application was not approved at this time.</p>
|
||||||
|
${rejection_reason ? `<p style="margin: 16px 0; padding: 12px 16px; background: #fee2e2; border-left: 4px solid #ef4444; color: #7f1d1d;"><strong>Feedback:</strong> ${rejection_reason}</p>` : ""}
|
||||||
|
<p>You're welcome to reapply with updates to your portfolio or qualifications.</p>
|
||||||
|
<p style="margin: 24px 0;">
|
||||||
|
<a href="https://aethex.dev/ethos" style="background: linear-gradient(135deg, #db2777, #9333ea); color: #fff; padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; display: inline-block;">Learn more about Ethos Guild</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
});
|
||||||
|
} catch (emailError) {
|
||||||
|
console.error("Failed to send rejection email:", emailError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.status(200).json({ data: request });
|
return res.status(200).json({ data: request });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue