0.12.10 : fix email template
All checks were successful
Build release Docker image / Build Docker Images (push) Successful in 12m55s

This commit is contained in:
2025-11-30 21:21:55 +01:00
parent 7df45f5c1c
commit 5428ceb17b
4 changed files with 173 additions and 6 deletions

View File

@@ -4,6 +4,8 @@ const utils = require("@strapi/utils");
const { concat, compact, isArray, toNumber, getOr } = require("lodash/fp");
const cryptoLib = require("crypto");
const bcrypt = require("bcryptjs");
const fs = require("fs").promises;
const path = require("path");
module.exports = (plugin) => {
const rawProviders = plugin.services.providers({ strapi });
@@ -49,10 +51,9 @@ module.exports = (plugin) => {
await edit(user.id, { confirmationToken });
const confirmUrl = `${process.env.NEXTJS_URL}/confirmation/submit?confirmation=${confirmationToken}`;
// Récupération du template HTML défini dans plugins.ts
let html = strapi
.plugin("email")
.config("settings.templates.confirmation.html") as string;
// Lecture du template HTML depuis le fichier
const htmlPath = path.join(__dirname, "confirmation.html");
let html = await fs.readFile(htmlPath, "utf-8");
// Remplacement des variables
html = html