Feedback-Window
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 50s

This commit is contained in:
Torsten Schulz (local)
2026-06-09 07:57:36 +02:00
parent f0142d5682
commit 16465fafc8
9 changed files with 208 additions and 3 deletions

View File

@@ -95,4 +95,43 @@ const sendFriendlyMatchInvitationEmail = async ({
await transporter.sendMail(mailOptions);
};
export { sendActivationEmail, sendPasswordResetEmail, sendFriendlyMatchInvitationEmail };
const escapeHtml = (value) => String(value ?? '')
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
const sendMobileFeedbackEmail = async ({
message,
screen,
clubId,
appVersion,
platform,
backendBaseUrl,
user,
}) => {
const mailOptions = {
from: process.env.EMAIL_USER,
to: 'tsschulz2001@gmail.com',
subject: `Android Feedback${screen ? ` - ${screen}` : ''}`,
html: `
<div style="font-family: Arial, sans-serif; max-width: 760px; margin: 0 auto;">
<h2 style="color:#1f2937;">Android Feedback</h2>
<p><strong>Seite:</strong> ${escapeHtml(screen || '-')}</p>
<p><strong>Verein-ID:</strong> ${escapeHtml(clubId ?? '-')}</p>
<p><strong>User:</strong> ${escapeHtml(user?.username || user?.email || user?.id || '-')}</p>
<p><strong>User-ID:</strong> ${escapeHtml(user?.id || '-')}</p>
<p><strong>App-Version:</strong> ${escapeHtml(appVersion || '-')}</p>
<p><strong>Plattform:</strong> ${escapeHtml(platform || 'Android')}</p>
<p><strong>Backend:</strong> ${escapeHtml(backendBaseUrl || '-')}</p>
<hr style="border:none;border-top:1px solid #e5e7eb;margin:16px 0;">
<h3 style="color:#1f2937;">Meldung</h3>
<div style="white-space:pre-wrap;background:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;padding:12px;">${escapeHtml(message)}</div>
</div>
`,
};
await transporter.sendMail(mailOptions);
};
export { sendActivationEmail, sendPasswordResetEmail, sendFriendlyMatchInvitationEmail, sendMobileFeedbackEmail };