Implement self-service account deletion
This commit is contained in:
parent
37c6fa3f79
commit
aa2348656d
13 changed files with 426 additions and 19 deletions
|
|
@ -26,6 +26,27 @@ class EmailController {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
async sendAccountDeletion(params = {}) {
|
||||
const { address, username } = params;
|
||||
|
||||
const deleteConfig = this.config.getDeleteAccount();
|
||||
|
||||
const html = deleteConfig.getHTML()
|
||||
.replace(/\$user\$/g, username);
|
||||
const text = deleteConfig.getText()
|
||||
.replace(/\$user\$/g, username);
|
||||
|
||||
const result = await this.mailer.sendMail({
|
||||
from: deleteConfig.getFrom(),
|
||||
to: `${username} <${address}>`,
|
||||
subject: deleteConfig.getSubject(),
|
||||
html,
|
||||
text
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export { EmailController };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue