Skip to content
Snippets Groups Projects
Commit a282f917 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: add claim structure email sending. It has been removed in a previous commit

parent 0228e6a0
No related branches found
No related tags found
2 merge requests!96release V1.10.0,!83Dev
...@@ -313,8 +313,28 @@ export class UsersService { ...@@ -313,8 +313,28 @@ export class UsersService {
return false; return false;
} }
/**
* Send to all admins validation email for structures
* new account.
*/
private async sendAdminStructureValidationMail(): Promise<any> {
const config = this.mailerService.config;
const ejsPath = this.mailerService.getTemplateLocation(config.templates.adminStructureClaim.ejs);
const jsonConfig = this.mailerService.loadJsonConfig(config.templates.adminStructureClaim.json);
const html = await ejs.renderFile(ejsPath, {
config,
});
const admins = await this.getAdmins();
admins.forEach((admin) => {
this.mailerService.send(admin.email, jsonConfig.subject, html);
});
}
public async updateStructureLinkedClaim(userEmail: string, idStructure: string): Promise<Types.ObjectId[]> { public async updateStructureLinkedClaim(userEmail: string, idStructure: string): Promise<Types.ObjectId[]> {
const stucturesLinked = this.updatePendingStructureLinked(userEmail, idStructure); const stucturesLinked = this.updatePendingStructureLinked(userEmail, idStructure);
this.sendAdminStructureValidationMail();
return stucturesLinked; return stucturesLinked;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment