diff --git a/src/mailer/mail-templates/adminStructureCreate.ejs b/src/mailer/mail-templates/adminStructureCreate.ejs index 41d58470fa059925b790e440caec3c5606dbda1c..47b79daa15b999739415094be15f42e9f641ede0 100644 --- a/src/mailer/mail-templates/adminStructureCreate.ejs +++ b/src/mailer/mail-templates/adminStructureCreate.ejs @@ -1,3 +1,9 @@ Bonjour<br /> <br /> -Une nouvelle structure a été créé: <strong><%= name %></strong>. +Une nouvelle structure a été créé: +<a href="<%= config.protocol %>://<%= config.host %><%= config.port ? ':' + config.port : '' %>/acteurs?id=<%= id %>" + ><strong><%= name %></strong></a +> +<br /> +Il est possible que la structure ne soit pas immédiatement visible sur la carto. L'utilisateur doit valider son compte +pour que celle-ci soit visible. diff --git a/src/structures/services/structures.service.ts b/src/structures/services/structures.service.ts index cf86a13399bb94d0a90dabb9ee2355b6ee7e308d..441d7022d82e56f8175c954d621cfb3ced95c130 100644 --- a/src/structures/services/structures.service.ts +++ b/src/structures/services/structures.service.ts @@ -41,7 +41,7 @@ export class StructuresService { user.save(); // Senc admin notification mail - this.userService.sendAdminNewStructureMail(createdStructure.structureName); + this.userService.sendAdminNewStructureMail(createdStructure.structureName, createdStructure._id); return createdStructure; } diff --git a/src/users/users.service.ts b/src/users/users.service.ts index e4a081cb3fb15b0d1f88bb68abb706069729be9e..00cb1129c062731347632cc2c3b64359a63e9839 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -159,7 +159,7 @@ export class UsersService { /** * Send to all admins notification email for new structures */ - public async sendAdminNewStructureMail(structureName: string): Promise<any> { + public async sendAdminNewStructureMail(structureName: string, structureId: string): Promise<any> { const config = this.mailerService.config; const ejsPath = this.mailerService.getTemplateLocation(config.templates.adminStructureCreate.ejs); const jsonConfig = this.mailerService.loadJsonConfig(config.templates.adminStructureCreate.json); @@ -167,6 +167,7 @@ export class UsersService { const html = await ejs.renderFile(ejsPath, { config, name: structureName, + id: structureId, }); const admins = await this.getAdmins(); admins.forEach((admin) => {