assets, move memories to proper location
This commit is contained in:
@@ -66,18 +66,24 @@ async function processReportGeneration(
|
||||
const { EmailService } = await import('@shieldai/shared-notifications');
|
||||
const emailService = EmailService.getInstance();
|
||||
|
||||
await emailService.send({
|
||||
channel: 'email',
|
||||
to: notifyEmail,
|
||||
subject: `ShieldAI: ${report.title} Ready`,
|
||||
htmlBody: `
|
||||
<h2>Your ShieldAI Protection Report is Ready</h2>
|
||||
<p><strong>${report.title}</strong></p>
|
||||
<p>${report.summary || 'View your report to see detailed protection statistics.'}</p>
|
||||
<p><a href="${process.env.DASHBOARD_URL || 'https://app.shieldai.com'}/reports/${report.id}">View Report</a></p>
|
||||
<p><a href="${process.env.DASHBOARD_URL || 'https://app.shieldai.com'}/api/v1/reports/${report.id}/pdf">Download PDF</a></p>
|
||||
`,
|
||||
textBody: `Your ShieldAI report "${report.title}" is ready. View it at ${process.env.DASHBOARD_URL || 'https://app.shieldai.com'}/reports/${report.id}`,
|
||||
const dashboardUrl = process.env.DASHBOARD_URL || 'https://app.shieldai.com';
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: { id: userId },
|
||||
select: { name: true, email: true },
|
||||
});
|
||||
|
||||
const userName = user?.name || notifyEmail.split('@')[0];
|
||||
|
||||
await emailService.sendWithTemplate(notifyEmail, {
|
||||
templateId: 'report_ready',
|
||||
variables: {
|
||||
name: userName,
|
||||
report_title: report.title,
|
||||
report_summary: report.summary || 'Your protection report contains detailed statistics and recommendations.',
|
||||
report_url: `${dashboardUrl}/reports/${report.id}`,
|
||||
pdf_url: report.pdfUrl || `${dashboardUrl}/api/v1/reports/${report.id}/pdf`,
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.securityReport.update({
|
||||
|
||||
Reference in New Issue
Block a user