This commit is contained in:
@@ -95,4 +95,43 @@ const sendFriendlyMatchInvitationEmail = async ({
|
||||
await transporter.sendMail(mailOptions);
|
||||
};
|
||||
|
||||
export { sendActivationEmail, sendPasswordResetEmail, sendFriendlyMatchInvitationEmail };
|
||||
const escapeHtml = (value) => String(value ?? '')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"');
|
||||
|
||||
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 };
|
||||
|
||||
Reference in New Issue
Block a user