design
This commit is contained in:
@@ -39,7 +39,39 @@ export class PortalMailService {
|
||||
});
|
||||
}
|
||||
|
||||
async sendRegistrationPendingApprovalMail(
|
||||
to: string[],
|
||||
registration: { email: string; displayName: string },
|
||||
): Promise<void> {
|
||||
const url = `${this.publicWebUrl}/admin/registrations`;
|
||||
await this.mailer.sendMail({
|
||||
to,
|
||||
subject: 'LDAP Portal: Registrierung wartet auf Freigabe',
|
||||
html: `
|
||||
<p>Eine Registrierung wurde per E-Mail bestaetigt und wartet jetzt auf Freigabe.</p>
|
||||
<p><strong>Name:</strong> ${this.escapeHtml(registration.displayName)}<br>
|
||||
<strong>E-Mail:</strong> ${this.escapeHtml(registration.email)}</p>
|
||||
<p><a href="${url}">${url}</a></p>
|
||||
`,
|
||||
text: [
|
||||
'Eine Registrierung wurde per E-Mail bestaetigt und wartet jetzt auf Freigabe.',
|
||||
`Name: ${registration.displayName}`,
|
||||
`E-Mail: ${registration.email}`,
|
||||
`Admin-Bereich: ${url}`,
|
||||
].join('\n'),
|
||||
});
|
||||
}
|
||||
|
||||
private get publicWebUrl(): string {
|
||||
return this.config.get<string>('PUBLIC_WEB_URL') ?? 'http://localhost:4200';
|
||||
}
|
||||
|
||||
private escapeHtml(value: string): string {
|
||||
return value
|
||||
.replaceAll('&', '&')
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>')
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll("'", ''');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user