Update email test and INCIDENT template
This commit is contained in:
@@ -3,7 +3,7 @@ import { getAuthHeaders, getBaseUrl, validateEmail } from '../utils';
|
|||||||
import { SettingsApiResponse } from '../types';
|
import { SettingsApiResponse } from '../types';
|
||||||
|
|
||||||
const createEmailTemplate = (template: string, data: any): { subject: string; htmlBody: string } => {
|
const createEmailTemplate = (template: string, data: any): { subject: string; htmlBody: string } => {
|
||||||
let subject = 'Test Email from ReamStack';
|
let subject = 'Test Email from CheckCle';
|
||||||
let htmlBody = `
|
let htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -13,7 +13,7 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p>If you received this email, your SMTP configuration is working correctly.</p>
|
<p>If you received this email, your SMTP configuration is working correctly.</p>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">
|
<p style="font-size: 12px; color: #666;">
|
||||||
Sent from ReamStack Monitoring System<br>
|
Sent from CheckCle Monitoring System<br>
|
||||||
Template: ${template}<br>
|
Template: ${template}<br>
|
||||||
${data.collection ? `Collection: ${data.collection}` : ''}
|
${data.collection ? `Collection: ${data.collection}` : ''}
|
||||||
</p>
|
</p>
|
||||||
@@ -24,7 +24,7 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
|
|
||||||
switch (template) {
|
switch (template) {
|
||||||
case 'verification':
|
case 'verification':
|
||||||
subject = 'Email Verification Test - ReamStack';
|
subject = 'Email Verification Test - CheckCle';
|
||||||
htmlBody = `
|
htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -37,14 +37,14 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
||||||
</div>
|
</div>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">Sent from ReamStack Monitoring System</p>
|
<p style="font-size: 12px; color: #666;">Sent from CheckCle Monitoring System</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`;
|
`;
|
||||||
break;
|
break;
|
||||||
case 'password-reset':
|
case 'password-reset':
|
||||||
subject = 'Password Reset Test - ReamStack';
|
subject = 'Password Reset Test - CheckCle';
|
||||||
htmlBody = `
|
htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -57,14 +57,14 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
||||||
</div>
|
</div>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">Sent from ReamStack Monitoring System</p>
|
<p style="font-size: 12px; color: #666;">Sent from CheckCle Monitoring System</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`;
|
`;
|
||||||
break;
|
break;
|
||||||
case 'email-change':
|
case 'email-change':
|
||||||
subject = 'Email Change Confirmation Test - ReamStack';
|
subject = 'Email Change Confirmation Test - CheckCle';
|
||||||
htmlBody = `
|
htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -76,7 +76,7 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p><strong>Template:</strong> Email Change Confirmation</p>
|
<p><strong>Template:</strong> Email Change Confirmation</p>
|
||||||
</div>
|
</div>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">Sent from ReamStack Monitoring System</p>
|
<p style="font-size: 12px; color: #666;">Sent from CheckCle Monitoring System</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -178,10 +178,6 @@ export const sendTestEmail = async (data: any): Promise<SettingsApiResponse> =>
|
|||||||
smtpPort: smtpSettings.port || 587
|
smtpPort: smtpSettings.port || 587
|
||||||
});
|
});
|
||||||
|
|
||||||
// For now, we'll simulate a successful email send
|
|
||||||
// In a real implementation, you would integrate with your email service here
|
|
||||||
// This could be nodemailer, SendGrid, or your PocketBase email system
|
|
||||||
|
|
||||||
// Simulate processing time
|
// Simulate processing time
|
||||||
console.log('Simulating email send...');
|
console.log('Simulating email send...');
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { getAuthHeaders, getBaseUrl, validateEmail } from '../utils';
|
|||||||
import { SettingsApiResponse } from '../types';
|
import { SettingsApiResponse } from '../types';
|
||||||
|
|
||||||
const createEmailTemplate = (template: string, data: any): { subject: string; htmlBody: string } => {
|
const createEmailTemplate = (template: string, data: any): { subject: string; htmlBody: string } => {
|
||||||
let subject = 'Test Email from ReamStack';
|
let subject = 'Test Email from CheckCle';
|
||||||
let htmlBody = `
|
let htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -12,7 +12,7 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p>If you received this email, your SMTP configuration is working correctly.</p>
|
<p>If you received this email, your SMTP configuration is working correctly.</p>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">
|
<p style="font-size: 12px; color: #666;">
|
||||||
Sent from ReamStack Monitoring System<br>
|
Sent from CheckCle Monitoring System<br>
|
||||||
Template: ${template}<br>
|
Template: ${template}<br>
|
||||||
${data.collection ? `Collection: ${data.collection}` : ''}
|
${data.collection ? `Collection: ${data.collection}` : ''}
|
||||||
</p>
|
</p>
|
||||||
@@ -23,7 +23,7 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
|
|
||||||
switch (template) {
|
switch (template) {
|
||||||
case 'verification':
|
case 'verification':
|
||||||
subject = 'Email Verification Test - ReamStack';
|
subject = 'Email Verification Test - CheckCle';
|
||||||
htmlBody = `
|
htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -36,14 +36,14 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
||||||
</div>
|
</div>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">Sent from ReamStack Monitoring System</p>
|
<p style="font-size: 12px; color: #666;">Sent from CheckCle Monitoring System</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`;
|
`;
|
||||||
break;
|
break;
|
||||||
case 'password-reset':
|
case 'password-reset':
|
||||||
subject = 'Password Reset Test - ReamStack';
|
subject = 'Password Reset Test - CheckCle';
|
||||||
htmlBody = `
|
htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -56,14 +56,14 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
<p><strong>Collection:</strong> ${data.collection || '_superusers'}</p>
|
||||||
</div>
|
</div>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">Sent from ReamStack Monitoring System</p>
|
<p style="font-size: 12px; color: #666;">Sent from CheckCle Monitoring System</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`;
|
`;
|
||||||
break;
|
break;
|
||||||
case 'email-change':
|
case 'email-change':
|
||||||
subject = 'Email Change Confirmation Test - ReamStack';
|
subject = 'Email Change Confirmation Test - CheckCle';
|
||||||
htmlBody = `
|
htmlBody = `
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||||
@@ -75,7 +75,7 @@ const createEmailTemplate = (template: string, data: any): { subject: string; ht
|
|||||||
<p><strong>Template:</strong> Email Change Confirmation</p>
|
<p><strong>Template:</strong> Email Change Confirmation</p>
|
||||||
</div>
|
</div>
|
||||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||||
<p style="font-size: 12px; color: #666;">Sent from ReamStack Monitoring System</p>
|
<p style="font-size: 12px; color: #666;">Sent from CheckCle Monitoring System</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export const AboutSystem: React.FC = () => {
|
|||||||
<span>{t('links')}</span>
|
<span>{t('links')}</span>
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<CardDescription className="font-medium text-base">
|
<CardDescription className="font-medium text-base">
|
||||||
{systemName || 'ReamStack'} {t('resources').toLowerCase()}
|
{systemName || 'CheckCle'} {t('resources').toLowerCase()}
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-4 pt-6">
|
<CardContent className="space-y-4 pt-6">
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ export const generatePdf = async (incident: IncidentItem): Promise<string> => {
|
|||||||
doc.setProperties({
|
doc.setProperties({
|
||||||
title: title,
|
title: title,
|
||||||
subject: 'Incident Report',
|
subject: 'Incident Report',
|
||||||
author: 'ReamStack System',
|
author: 'CheckCle System',
|
||||||
creator: 'ReamStack',
|
creator: 'CheckCle',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add header section
|
// Add header section
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ export const addHeader = (doc: jsPDF, incident: IncidentItem): number => {
|
|||||||
doc.setFontSize(10);
|
doc.setFontSize(10);
|
||||||
doc.text(`Generated on: ${new Date().toLocaleDateString()}`, 105, yPos, { align: 'center' });
|
doc.text(`Generated on: ${new Date().toLocaleDateString()}`, 105, yPos, { align: 'center' });
|
||||||
|
|
||||||
// Add ReamStack logo or text
|
// Add CheckCle logo or text
|
||||||
yPos += 8;
|
yPos += 8;
|
||||||
doc.setFontSize(12);
|
doc.setFontSize(12);
|
||||||
doc.setFont(fonts.italic);
|
doc.setFont(fonts.italic);
|
||||||
doc.text('ReamStack Incident Management', 105, yPos, { align: 'center' });
|
doc.text('CheckCle Incident Management', 105, yPos, { align: 'center' });
|
||||||
|
|
||||||
// Add horizontal line
|
// Add horizontal line
|
||||||
yPos += 5;
|
yPos += 5;
|
||||||
@@ -53,7 +53,7 @@ export const addFooter = (doc: jsPDF): void => {
|
|||||||
doc.setFontSize(8);
|
doc.setFontSize(8);
|
||||||
doc.setTextColor(100, 100, 100);
|
doc.setTextColor(100, 100, 100);
|
||||||
doc.text(
|
doc.text(
|
||||||
`Page ${i} of ${pageCount} | Generated by ReamStack Incident Management System`,
|
`Page ${i} of ${pageCount} | Generated by CheckCle Incident Management System`,
|
||||||
105,
|
105,
|
||||||
285,
|
285,
|
||||||
{ align: 'center' }
|
{ align: 'center' }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
export interface AboutTranslations {
|
export interface AboutTranslations {
|
||||||
aboutReamStack: string;
|
aboutCheckCle: string;
|
||||||
systemDescription: string;
|
systemDescription: string;
|
||||||
systemVersion: string;
|
systemVersion: string;
|
||||||
license: string;
|
license: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user